]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: fix BFD configuration update on TTL change
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Tue, 2 Nov 2021 21:54:23 +0000 (18:54 -0300)
committermergify-bot <noreply@mergify.io>
Sat, 6 Nov 2021 15:09:25 +0000 (15:09 +0000)
When altering the TTL of a eBGP peer also update the BFD
configuration. This was only working when the configuration happened
after the peer connection had been established.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 4ba37eb691f9574e908ec7ed03e8f4cb4214f2d5)

bgpd/bgpd.c

index a8230091799c850d2787f8d09089bee22787a41d..82f59150cbbcb8ae31542327250d69c3c940adfe 100644 (file)
@@ -4751,6 +4751,10 @@ int peer_ebgp_multihop_set(struct peer *peer, int ttl)
                                                BGP_NOTIFY_CEASE_CONFIG_CHANGE);
                        else
                                bgp_session_reset(peer);
+
+                       /* Reconfigure BFD peer with new TTL. */
+                       if (peer->bfd_config)
+                               bgp_peer_bfd_update_source(peer);
                }
        } else {
                group = peer->group;
@@ -4765,6 +4769,10 @@ int peer_ebgp_multihop_set(struct peer *peer, int ttl)
                                                BGP_NOTIFY_CEASE_CONFIG_CHANGE);
                        else
                                bgp_session_reset(peer);
+
+                       /* Reconfigure BFD peer with new TTL. */
+                       if (peer->bfd_config)
+                               bgp_peer_bfd_update_source(peer);
                }
        }
        return 0;
@@ -4798,6 +4806,10 @@ int peer_ebgp_multihop_unset(struct peer *peer)
                                        BGP_NOTIFY_CEASE_CONFIG_CHANGE);
                else
                        bgp_session_reset(peer);
+
+               /* Reconfigure BFD peer with new TTL. */
+               if (peer->bfd_config)
+                       bgp_peer_bfd_update_source(peer);
        } else {
                group = peer->group;
                for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) {
@@ -4814,6 +4826,10 @@ int peer_ebgp_multihop_unset(struct peer *peer)
                                else
                                        bgp_session_reset(peer);
                        }
+
+                       /* Reconfigure BFD peer with new TTL. */
+                       if (peer->bfd_config)
+                               bgp_peer_bfd_update_source(peer);
                }
        }
        return 0;