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>
{
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]
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;
+}
extern int bfd_nht_update(const struct prefix *match,
const struct zapi_route *route);
+extern bool bfd_session_is_down(const struct bfd_session_params *session);
+
#ifdef __cplusplus
}
#endif