From 68286f96197c7d1775eb75acc6713b05e57a95d7 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Thu, 21 May 2020 16:00:12 -0300 Subject: [PATCH] bgpd: command to remove profile configuration To remove a BFD profile without removing the BFD configuration just call `neighbor bfd`. Signed-off-by: Rafael Zalamena --- bgpd/bgp_bfd.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 4e237120a1..74ff6f4472 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -474,6 +474,7 @@ static int bgp_bfd_peer_param_set(struct peer *peer, uint32_t min_rx, uint32_t min_tx, uint8_t detect_mult, int defaults) { + struct bfd_info *bi; struct peer_group *group; struct listnode *node, *nnode; int command = 0; @@ -481,6 +482,10 @@ static int bgp_bfd_peer_param_set(struct peer *peer, uint32_t min_rx, bfd_set_param((struct bfd_info **)&(peer->bfd_info), min_rx, min_tx, detect_mult, defaults, &command); + /* This command overrides profile if it was previously applied. */ + bi = peer->bfd_info; + bi->profile[0] = 0; + if (CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) { group = peer->group; for (ALL_LIST_ELEMENTS(group->peer, node, nnode, peer)) { @@ -489,6 +494,13 @@ static int bgp_bfd_peer_param_set(struct peer *peer, uint32_t min_rx, min_rx, min_tx, detect_mult, defaults, &command); + /* + * This command overrides profile if it was previously + * applied. + */ + bi = peer->bfd_info; + bi->profile[0] = 0; + if ((peer->status == Established) && (command == ZEBRA_BFD_DEST_REGISTER)) bgp_bfd_register_peer(peer);