bgpd: Treat the peer as not active due to BFD down only if established

If we have `neighbor X bfd` and BFD status is DOWN and/or ADMIN_DOWN, and BGP
session is not yet established, we never allow the session to establish.

Let's fix this regression that was in 10.2.

Fixes: 1fb48f5 ("bgpd: Do not start BGP session if BFD profile is in shutdown state")

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2025-04-02 17:24:09 +03:00
parent d10b08e4e8
commit da4a7b0356

View file

@ -4789,7 +4789,7 @@ enum bgp_peer_active peer_active(struct peer_connection *connection)
return BGP_PEER_CONNECTION_UNSPECIFIED;
if (peer->bfd_config) {
if (bfd_session_is_down(peer->bfd_config->session))
if (peer_established(connection) && bfd_session_is_down(peer->bfd_config->session))
return BGP_PEER_BFD_DOWN;
}