summaryrefslogtreecommitdiffstats
path: root/vrrpd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-04-24 19:02:14 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commit33b010a97693cef8bbe120d8205099b581e573fe (patch)
tree7db0ffb22d82ef8258bf7bf723163fe7b7279010 /vrrpd
parenttools: fix vrrp autoconfigure reload (diff)
downloadfrr-33b010a97693cef8bbe120d8205099b581e573fe.tar.xz
frr-33b010a97693cef8bbe120d8205099b581e573fe.zip
vrrpd: convert defaults command to milliseconds
Missed this in the conversion from centiseconds to milliseconds. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-rw-r--r--vrrpd/vrrp.c2
-rw-r--r--vrrpd/vrrp_vty.c13
2 files changed, 11 insertions, 4 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 7b66492c1..1e01307ed 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -2300,7 +2300,7 @@ int vrrp_config_write_global(struct vty *vty)
if (vd.advertisement_interval != VRRP_DEFAULT_ADVINT && ++writes)
vty_out(vty,
"vrrp default advertisement-interval %" PRIu16 "\n",
- vd.advertisement_interval);
+ vd.advertisement_interval * CS2MS);
if (vd.preempt_mode != VRRP_DEFAULT_PREEMPT && ++writes)
vty_out(vty, "%svrrp default preempt\n",
diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c
index 0cb33bffe..296a8a67d 100644
--- a/vrrpd/vrrp_vty.c
+++ b/vrrpd/vrrp_vty.c
@@ -315,19 +315,26 @@ DEFPY(vrrp_autoconfigure,
DEFPY(vrrp_default,
vrrp_default_cmd,
- "[no] vrrp default <advertisement-interval$adv (1-4096)$advint|preempt$p|priority$prio (1-254)$prioval|shutdown$s>",
+ "[no] vrrp default <advertisement-interval$adv (10-40950)$advint|preempt$p|priority$prio (1-254)$prioval|shutdown$s>",
NO_STR
VRRP_STR
"Configure defaults for new VRRP instances\n"
VRRP_ADVINT_STR
- "Advertisement interval in centiseconds\n"
+ "Advertisement interval in milliseconds\n"
"Preempt mode\n"
VRRP_PRIORITY_STR
"Priority value\n"
"Force VRRP router into administrative shutdown\n")
{
- if (adv)
+ if (adv) {
+ if (advint % 10 != 0) {
+ vty_out(vty, "%% Value must be a multiple of 10\n");
+ return CMD_WARNING_CONFIG_FAILED;
+ }
+ /* all internal computations are in centiseconds */
+ advint /= CS2MS;
vd.advertisement_interval = no ? VRRP_DEFAULT_ADVINT : advint;
+ }
if (p)
vd.preempt_mode = !no;
if (prio)