From 4ba37eb691f9574e908ec7ed03e8f4cb4214f2d5 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 --- bgpd/bgpd.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index c5a5e49a48..bc731ff2b8 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -4752,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); } } else { group = peer->group; @@ -4766,6 +4770,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; @@ -4799,6 +4807,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)) { @@ -4815,6 +4827,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;