diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-05-20 00:30:21 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-05-29 22:48:14 +0200 |
commit | 18322efd130a7ce60a2c8b731494d12edb1c937e (patch) | |
tree | 061f5f5c1c4549e9a22361e71c08024823366d6c /bfdd/bfd.c | |
parent | Merge pull request #6481 from donaldsharp/bgp_thread_cancel (diff) | |
download | frr-18322efd130a7ce60a2c8b731494d12edb1c937e.tar.xz frr-18322efd130a7ce60a2c8b731494d12edb1c937e.zip |
bfdd,lib: implement protocol profile selection
Implement the infrastructure for other protocols daemon (e.g. `bgpd`,
`ospfd`, `isisd` etc...) to communicate to BFD daemon which profile
they want to use with their peers.
It was also added the ability for protocols to change profile while
running (no need to remove the registration and then register again).
The protocols message building function was rewritten to support
multiple arguments through `struct bfd_session_arg`, so we can
implement new features without the need of changing function
prototypes. The old function was also rewritten to keep
compatibility.
The profile message part is only available for BFD daemon at the
moment.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfd.c')
-rw-r--r-- | bfdd/bfd.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c index a021b5cab..f51136e98 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -765,6 +765,15 @@ static void _bfd_session_update(struct bfd_session *bs, */ bs->peer_profile.admin_shutdown = bpc->bpc_shutdown; bfd_set_shutdown(bs, bpc->bpc_shutdown); + + /* + * Apply profile last: it also calls `bfd_set_shutdown`. + * + * There is no problem calling `shutdown` twice if the value doesn't + * change or if it is overriden by peer specific configuration. + */ + if (bpc->bpc_has_profile) + bfd_profile_apply(bpc->bpc_profile, bs); } static int bfd_session_update(struct bfd_session *bs, struct bfd_peer_cfg *bpc) |