summaryrefslogtreecommitdiffstats
path: root/staticd
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2023-01-23 11:57:57 +0100
committerLouis Scalbert <louis.scalbert@6wind.com>2023-01-24 16:08:04 +0100
commita77ea81ef34c05bd2b84260c7bbbf9d32443ca7f (patch)
tree418b0a16ab76b8d9446f1b00e5c85ec5ce9556f1 /staticd
parentMerge pull request #12681 from pguibert6WIND/vpnv6_encode_plus (diff)
downloadfrr-a77ea81ef34c05bd2b84260c7bbbf9d32443ca7f.tar.xz
frr-a77ea81ef34c05bd2b84260c7bbbf9d32443ca7f.zip
lib: do not reopen a zclient socket for bfd
b7ca809d1c ("lib: BFD automatic source selection") has added a dedicated zclient socket for nht tracking. Since the bfd lib is used by daemons that already has a zclient socket, those daemons has now a second zclient socket. However, zebra does not distinguish the two zclient sessions. For example, the interfaces are asked a second via zebra_message_send(zclient, ZEBRA_INTERFACE_ADD, VRF_DEFAULT) in zclient_start(). As a result, callbacks functions like bgp_ifp_create() are called a second time, which causes some processing overhead and might cause bugs. Re-use the existing zclient socket for nht tracking. Note that BFD automatic source selection is only currently implemented in staticd. Other daemons will require to add the following in their ZEBRA_NEXTHOP_UPDATE callback function: > if (zclient->bfd_integration) > bfd_nht_update(&matched, &nhr); Fixes: b7ca809d1c ("lib: BFD automatic source selection") Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_zebra.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c
index 316247adb..f4f9878e8 100644
--- a/staticd/static_zebra.c
+++ b/staticd/static_zebra.c
@@ -182,6 +182,8 @@ 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
@@ -211,6 +213,9 @@ static int static_zebra_nexthop_update(ZAPI_CALLBACK_ARGS)
return 1;
}
+ if (zclient->bfd_integration)
+ bfd_nht_update(&matched, &nhr);
+
if (matched.family == AF_INET6)
afi = AFI_IP6;