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>
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;
}