summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_pw.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-02-18 01:02:55 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-02-23 13:08:36 +0100
commit55cd0f612a046137f0be936e7856921ada4546ca (patch)
tree33ebc2df612fe462d3f422834fe6c99c409320f1 /zebra/zebra_pw.c
parentzebra: On shutdown don't count removals (diff)
downloadfrr-55cd0f612a046137f0be936e7856921ada4546ca.tar.xz
frr-55cd0f612a046137f0be936e7856921ada4546ca.zip
*: Make assignment from RB_ROOT in while loop work better
Fix up the assignment of the variable = RB_ROOT inside of while loop patter we were using. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/zebra_pw.c')
-rw-r--r--zebra/zebra_pw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/zebra/zebra_pw.c b/zebra/zebra_pw.c
index bbd01a759..96bee36be 100644
--- a/zebra/zebra_pw.c
+++ b/zebra/zebra_pw.c
@@ -294,8 +294,11 @@ void zebra_pw_exit(struct zebra_vrf *zvrf)
{
struct zebra_pw *pw;
- while ((pw = RB_ROOT(zebra_pw_head, &zvrf->pseudowires)) != NULL)
+ while (!RB_EMPTY(zebra_pw_head, &zvrf->pseudowires)) {
+ pw = RB_ROOT(zebra_pw_head, &zvrf->pseudowires);
+
zebra_pw_del(zvrf, pw);
+ }
}
DEFUN_NOSH (pseudowire_if,