]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: When bgp notices a change to shared_network inform bfd of it
authorDonald Sharp <sharpd@nvidia.com>
Thu, 5 Dec 2024 15:16:03 +0000 (10:16 -0500)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Wed, 12 Feb 2025 21:39:24 +0000 (23:39 +0200)
When bgp is started up and reads the config in *before* it has
received interface addresses from zebra, shared_network can
be set to false in this case.  Later on once bgp attempts to
reconnect it will refigure out the shared_network again( because
it has received the data from zebra now ).  In this case
tell bfd about it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_zebra.c

index 2e9c54e1265a4eae0f10d5a3ddc858882673d0b3..10e823c14f2c71379f5c03ae47716b7208aa5848 100644 (file)
@@ -744,6 +744,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
        int ret = 0;
        struct interface *ifp = NULL;
        bool v6_ll_avail = true;
+       bool shared_network_original = peer->shared_network;
 
        memset(nexthop, 0, sizeof(struct bgp_nexthop));
 
@@ -908,6 +909,9 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
                        peer->shared_network = 0;
        }
 
+       if (shared_network_original != peer->shared_network)
+               bgp_peer_bfd_update_source(peer);
+
 /* KAME stack specific treatment.  */
 #ifdef KAME
        if (IN6_IS_ADDR_LINKLOCAL(&nexthop->v6_global)