evaluate_paths(bnc);
}
+/*
+ * Cleanup nexthop registration and status information for BGP nexthops
+ * pertaining to this VRF. This is invoked upon VRF deletion.
+ */
+void bgp_cleanup_nexthops(struct bgp *bgp)
+{
+ afi_t afi;
+ struct bgp_node *rn;
+ struct bgp_nexthop_cache *bnc;
+
+ for (afi = AFI_IP; afi < AFI_MAX; afi++) {
+ if (!bgp->nexthop_cache_table[afi])
+ continue;
+
+ for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
+ rn = bgp_route_next(rn)) {
+ if ((bnc = rn->info) == NULL)
+ continue;
+
+ /* Clear relevant flags. */
+ UNSET_FLAG(bnc->flags, BGP_NEXTHOP_VALID);
+ UNSET_FLAG(bnc->flags, BGP_NEXTHOP_REGISTERED);
+ UNSET_FLAG(bnc->flags, BGP_NEXTHOP_PEER_NOTIFIED);
+ }
+ }
+}
+
/**
* make_prefix - make a prefix structure from the path (essentially
* path's node.
*/
extern void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer);
+/*
+ * Cleanup nexthop registration and status information for BGP nexthops
+ * pertaining to this VRF. This is invoked upon VRF deletion.
+ */
+extern void bgp_cleanup_nexthops(struct bgp *bgp);
+
#endif /* _BGP_NHT_H */
/* Purge network and redistributed routes. */
bgp_purge_static_redist_routes(bgp);
+
+ /* Cleanup registered nexthops (flags) */
+ bgp_cleanup_nexthops(bgp);
}
/* Delete BGP instance. */