]> git.puffer.fish Git - mirror/frr.git/commitdiff
vrrpd: convert defaults command to milliseconds
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 24 Apr 2019 17:02:14 +0000 (17:02 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 May 2019 00:27:08 +0000 (00:27 +0000)
Missed this in the conversion from centiseconds to milliseconds.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c
vrrpd/vrrp_vty.c

index 7b66492c11ff8b800e924046ba4b143a3f1d6d8b..1e01307ed1b2c5b49fd15023e017cf562a437a38 100644 (file)
@@ -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",
index 0cb33bffed6f552bb03ccc1f39139c93170be791..296a8a67dd89a18ed1f76c31a97890a3a9e8dcf3 100644 (file)
@@ -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)