summaryrefslogtreecommitdiff
path: root/lib/if.c
diff options
context:
space:
mode:
authorMitesh Kanjariya <mitesh@cumulusnetworks.com>2018-02-27 02:47:36 -0800
committerGitHub <noreply@github.com>2018-02-27 02:47:36 -0800
commit00cbfad6de99dd70df21cb43f624e364eb0d0f02 (patch)
tree2b10d7793db2b0ee4ba6e06811348cf1c61578d5 /lib/if.c
parentf487dcaf74c9bd7a716a749d15281d5b92d363d4 (diff)
parentac3133a35d340a765be1518c2669b979e39fbe66 (diff)
Merge branch 'master' into evpn-bug-fixes
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/if.c b/lib/if.c
index 7866ddb8c4..12d123a8fa 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1064,7 +1064,7 @@ ifaddr_ipv4_lookup (struct in_addr *addr, ifindex_t ifindex)
rn = route_node_lookup (ifaddr_ipv4_table, (struct prefix *) &p);
if (! rn)
return NULL;
-
+
ifp = rn->info;
route_unlock_node (rn);
return ifp;
@@ -1078,7 +1078,9 @@ void if_terminate(struct vrf *vrf)
{
struct interface *ifp;
- while ((ifp = RB_ROOT(if_name_head, &vrf->ifaces_by_name)) != NULL) {
+ while (!RB_EMPTY(if_name_head, &vrf->ifaces_by_name)) {
+ ifp = RB_ROOT(if_name_head, &vrf->ifaces_by_name);
+
if (ifp->node) {
ifp->node->info = NULL;
route_unlock_node(ifp->node);