summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2020-05-21 16:00:12 -0300
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-05-29 17:48:14 -0300
commit68286f96197c7d1775eb75acc6713b05e57a95d7 (patch)
treeb7ae1b57d1fc2e2f1473f15dfe787c9fa2522e45
parent55d1a98423a789f85acae911926e1d5b67c3d8c7 (diff)
bgpd: command to remove profile configuration
To remove a BFD profile without removing the BFD configuration just call `neighbor <A.B.C.D|X:X::X:X|WORD> bfd`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
-rw-r--r--bgpd/bgp_bfd.c12
1 files changed, 12 insertions, 0 deletions
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);