struct zebra_lsp *lsp;
struct hash *lsp_table;
struct zebra_nhlfe *nhlfe;
- bool in_shutdown = false;
/* If zebra is shutting down, don't delete any structs,
* just ignore this callback. The LSPs will be cleaned up
* during the shutdown processing.
*/
- in_shutdown = atomic_load_explicit(&zrouter.in_shutdown,
- memory_order_relaxed);
- if (in_shutdown)
+ if (zebra_router_in_shutdown())
return;
zvrf = vrf_info_lookup(VRF_DEFAULT);
/* If we're in shutdown, this interface event needs to clean
* up installed NHGs, so don't clear that flag directly.
*/
- if (!zrouter.in_shutdown)
+ if (!zebra_router_in_shutdown())
UNSET_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED);
/* Update validity of nexthops depending on it */
nhe->refcnt--;
- if (!zrouter.in_shutdown && nhe->refcnt <= 0 &&
+ if (!zebra_router_in_shutdown() && nhe->refcnt <= 0 &&
CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_INSTALLED) &&
!CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_KEEP_AROUND)) {
nhe->refcnt = 1;
zrouter.supports_nhgs = support;
}
+static inline bool zebra_router_in_shutdown(void)
+{
+ return atomic_load_explicit(&zrouter.in_shutdown, memory_order_relaxed);
+}
+
/* zebra_northbound.c */
extern const struct frr_yang_module_info frr_zebra_info;