summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2018-07-10 16:00:09 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2018-08-08 23:25:08 +0200
commitd3f3a2c4dceb345d8702f51b7a37b2afc80dec70 (patch)
tree6976759328a85bd946b866bd9b31915a1740e86a /bfdd
parentbfdd: show the correct transmission speed (diff)
downloadfrr-d3f3a2c4dceb345d8702f51b7a37b2afc80dec70.tar.xz
frr-d3f3a2c4dceb345d8702f51b7a37b2afc80dec70.zip
bfdd: smooth configuration transition
After configuring a new value set the polling bit to negotiate speeds again next transmission cycle. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c8
-rw-r--r--bfdd/bfd.h1
-rw-r--r--bfdd/bfdd_vty.c16
3 files changed, 25 insertions, 0 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index 16a3a688f..d2aba178a 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -838,6 +838,14 @@ int ptm_bfd_ses_del(struct bfd_peer_cfg *bpc)
return 0;
}
+void bfd_set_polling(struct bfd_session *bs)
+{
+ bs->new_timers.desired_min_tx = bs->up_min_tx;
+ bs->new_timers.required_min_rx = bs->timers.required_min_rx;
+ bs->new_timers.required_min_echo = bs->timers.required_min_echo;
+ bs->polling = 1;
+}
+
/*
* Helper functions.
diff --git a/bfdd/bfd.h b/bfdd/bfd.h
index dc33d1c46..8f7dd1b8c 100644
--- a/bfdd/bfd.h
+++ b/bfdd/bfd.h
@@ -540,6 +540,7 @@ struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp, char *port_name,
struct bfd_session *bs_peer_find(struct bfd_peer_cfg *bpc);
int bfd_session_update_label(struct bfd_session *bs, const char *nlabel);
+void bfd_set_polling(struct bfd_session *bs);
const char *satostr(struct sockaddr_any *sa);
const char *diag2str(uint8_t diag);
int strtosa(const char *addr, struct sockaddr_any *sa);
diff --git a/bfdd/bfdd_vty.c b/bfdd/bfdd_vty.c
index 6bd488f67..b9a33b122 100644
--- a/bfdd/bfdd_vty.c
+++ b/bfdd/bfdd_vty.c
@@ -154,7 +154,11 @@ DEFPY(bfd_peer_detectmultiplier, bfd_peer_detectmultiplier_cmd,
struct bfd_session *bs;
bs = VTY_GET_CONTEXT(bfd_session);
+ if (bs->detect_mult == multiplier)
+ return CMD_SUCCESS;
+
bs->detect_mult = multiplier;
+ bfd_set_polling(bs);
return CMD_SUCCESS;
}
@@ -167,7 +171,11 @@ DEFPY(bfd_peer_recvinterval, bfd_peer_recvinterval_cmd,
struct bfd_session *bs;
bs = VTY_GET_CONTEXT(bfd_session);
+ if (bs->timers.required_min_rx == (uint32_t)(interval * 1000))
+ return CMD_SUCCESS;
+
bs->timers.required_min_rx = interval * 1000;
+ bfd_set_polling(bs);
return CMD_SUCCESS;
}
@@ -180,7 +188,11 @@ DEFPY(bfd_peer_txinterval, bfd_peer_txinterval_cmd,
struct bfd_session *bs;
bs = VTY_GET_CONTEXT(bfd_session);
+ if (bs->up_min_tx == (uint32_t)(interval * 1000))
+ return CMD_SUCCESS;
+
bs->up_min_tx = interval * 1000;
+ bfd_set_polling(bs);
return CMD_SUCCESS;
}
@@ -193,7 +205,11 @@ DEFPY(bfd_peer_echointerval, bfd_peer_echointerval_cmd,
struct bfd_session *bs;
bs = VTY_GET_CONTEXT(bfd_session);
+ if (bs->timers.required_min_echo == (uint32_t)(interval * 1000))
+ return CMD_SUCCESS;
+
bs->timers.required_min_echo = interval * 1000;
+ bfd_set_polling(bs);
return CMD_SUCCESS;
}