diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-06-12 08:39:48 +0300 | 
|---|---|---|
| committer | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-06-12 08:39:48 +0300 | 
| commit | 1fb48f5d13faf4ec1e6d4c2cdded9ca2dcd6d609 (patch) | |
| tree | 93ad1bfde17c9bc3512d61fa6d77b9c65a9c34ab /lib/bfd.c | |
| parent | ae1f3a48513f51c540788a090b05c24750665f55 (diff) | |
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>
Diffstat (limited to 'lib/bfd.c')
| -rw-r--r-- | lib/bfd.c | 6 | 
1 files changed, 6 insertions, 0 deletions
@@ -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; +}  | 
