]> 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:10 +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 80191c739dea3f53cd7242b1b2dd55438d0175db..362f1ee01557b3c0c612e5193465d81725855e95 100644 (file)
@@ -4734,6 +4734,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;
@@ -4748,6 +4752,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;
@@ -4781,6 +4789,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)) {
@@ -4797,6 +4809,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;