From b01ab324c2a5ba397fe9c45a9af408b2a5b8a788 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Tue, 2 Nov 2021 18:54:23 -0300 Subject: [PATCH] bgpd: fix BFD configuration update on TTL change 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 (cherry picked from commit 4ba37eb691f9574e908ec7ed03e8f4cb4214f2d5) --- bgpd/bgpd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index a823009179..82f59150cb 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -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; -- 2.39.5