diff --git a/lib/if.c b/lib/if.c index 8f15230f2334..378ca16e4957 100644 --- a/lib/if.c +++ b/lib/if.c @@ -1002,12 +1002,6 @@ void if_terminate(struct vrf *vrf) 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); - ifp->node = NULL; - } if_delete(&ifp); } } diff --git a/lib/if.h b/lib/if.h index 0dc56bd21098..c2ec73378d85 100644 --- a/lib/if.h +++ b/lib/if.h @@ -295,8 +295,6 @@ struct interface { struct if_data stats; #endif /* HAVE_NET_RT_IFLIST */ - struct route_node *node; - struct vrf *vrf; /* diff --git a/zebra/interface.c b/zebra/interface.c index 74e2500532d4..86de5dbae68e 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -215,6 +215,8 @@ static int if_zebra_delete_hook(struct interface *ifp) if_nhg_dependents_release(ifp); nhg_connected_tree_free(&zebra_if->nhg_dependents); + zebra_ns_unlink_ifp(ifp); + XFREE(MTYPE_ZIF_DESC, zebra_if->desc); EVENT_OFF(zebra_if->speed_update); @@ -730,7 +732,6 @@ void if_delete_update(struct interface **pifp) for setting ifindex to IFINDEX_INTERNAL after processing the interface deletion message. */ if_set_index(ifp, IFINDEX_INTERNAL); - ifp->node = NULL; UNSET_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);