mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 21:47:15 +02:00
bgpd: Do not start BGP session if BFD profile is in shutdown state
If we do: ``` bfd profile foo shutdown ``` The session is dropped, but immediately established again because we don't have a proper check on BFD. If BFD is administratively shutdown, ignore starting the session. Fixes: https://github.com/FRRouting/frr/issues/16186 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
parent
ae1f3a4851
commit
1fb48f5d13
|
@ -4507,6 +4507,12 @@ bool peer_active(struct peer *peer)
|
|||
{
|
||||
if (BGP_CONNECTION_SU_UNSPEC(peer->connection))
|
||||
return false;
|
||||
|
||||
if (peer->bfd_config) {
|
||||
if (bfd_session_is_down(peer->bfd_config->session))
|
||||
return false;
|
||||
}
|
||||
|
||||
if (peer->afc[AFI_IP][SAFI_UNICAST] || peer->afc[AFI_IP][SAFI_MULTICAST]
|
||||
|| peer->afc[AFI_IP][SAFI_LABELED_UNICAST]
|
||||
|| peer->afc[AFI_IP][SAFI_MPLS_VPN] || peer->afc[AFI_IP][SAFI_ENCAP]
|
||||
|
|
|
@ -1334,3 +1334,9 @@ int bfd_nht_update(const struct prefix *match, const struct zapi_route *route)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool bfd_session_is_down(const struct bfd_session_params *session)
|
||||
{
|
||||
return session->bss.state == BSS_DOWN ||
|
||||
session->bss.state == BSS_ADMIN_DOWN;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue