diff options
author | Louis Scalbert <louis.scalbert@6wind.com> | 2023-01-23 13:33:22 +0100 |
---|---|---|
committer | Louis Scalbert <louis.scalbert@6wind.com> | 2023-01-24 16:08:26 +0100 |
commit | f6e7fbdae9660d7abbb344b5e19fc68fb87bda78 (patch) | |
tree | fa1972555a341326fba46b85ebac6e9f215731e9 | |
parent | lib: do not reopen a zclient socket for bfd (diff) | |
download | frr-f6e7fbdae9660d7abbb344b5e19fc68fb87bda78.tar.xz frr-f6e7fbdae9660d7abbb344b5e19fc68fb87bda78.zip |
lib: remove concurrent nexthop zapi (un)registration
Daemons like staticd already implement nexthop zapi (un)registration.
b7ca809d1c ("lib: BFD automatic source selection") has implemented a
concurrent nexthop (un)registration. Some nexthop could be unregistred
by the bfd whereas they were still needed by the daemon.
Let the deamons deal with nexthop zapi (un)registration.
Fixes: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r-- | lib/bfd.c | 30 | ||||
-rw-r--r-- | lib/bfd.h | 2 | ||||
-rw-r--r-- | staticd/static_zebra.c | 2 |
3 files changed, 0 insertions, 34 deletions
@@ -149,22 +149,6 @@ static const struct in6_addr i6a_zero; static void bfd_source_cache_get(struct bfd_session_params *session); static void bfd_source_cache_put(struct bfd_session_params *session); -static inline void -bfd_source_cache_register(const struct bfd_source_cache *source) -{ - zclient_send_rnh(bsglobal.zc, ZEBRA_NEXTHOP_REGISTER, &source->address, - SAFI_UNICAST, false, false, source->vrf_id); -} - -static inline void -bfd_source_cache_unregister(const struct bfd_source_cache *source) -{ - zclient_send_rnh(bsglobal.zc, ZEBRA_NEXTHOP_UNREGISTER, - &source->address, SAFI_UNICAST, false, false, - source->vrf_id); -} - - /* * bfd_get_peer_info - Extract the Peer information for which the BFD session * went down from the message sent from Zebra to clients. @@ -1226,8 +1210,6 @@ static void bfd_source_cache_get(struct bfd_session_params *session) session->source_cache = source; source->refcount = 1; - bfd_source_cache_register(source); - return; } @@ -1242,7 +1224,6 @@ static void bfd_source_cache_put(struct bfd_session_params *session) return; } - bfd_source_cache_unregister(session->source_cache); SLIST_REMOVE(&bsglobal.source_list, session->source_cache, bfd_source_cache, entry); XFREE(MTYPE_BFD_SOURCE, session->source_cache); @@ -1352,17 +1333,6 @@ static bool bfd_source_cache_update(struct bfd_source_cache *source, return false; } -void bfd_nht_zclient_connected(struct zclient *zclient) -{ - struct bfd_source_cache *source; - - if (bsglobal.debugging) - zlog_debug("BFD NHT zclient connected"); - - SLIST_FOREACH (source, &bsglobal.source_list, entry) - bfd_source_cache_register(source); -} - int bfd_nht_update(const struct prefix *match, const struct zapi_route *route) { struct bfd_source_cache *source; @@ -473,8 +473,6 @@ extern bool bfd_protocol_integration_debug(void); */ extern bool bfd_protocol_integration_shutting_down(void); -extern void bfd_nht_zclient_connected(struct zclient *zclient); - /* Update nexthop-tracking (nht) information for BFD auto source selection. * The function must be called from the daemon callback function * that deals with the ZEBRA_NEXTHOP_UPDATE zclient command diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index f4f9878e8..85e4b1c03 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -182,8 +182,6 @@ static void zebra_connected(struct zclient *zclient) zclient_send_reg_requests(zclient, VRF_DEFAULT); static_fixup_vrf_ids(vrf_info_lookup(VRF_DEFAULT)); - - bfd_nht_zclient_connected(zclient); } /* API to check whether the configured nexthop address is |