]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: verify metrics on metric-style transition
authorChristian Franke <chris@opensourcerouting.org>
Tue, 27 Nov 2012 19:52:00 +0000 (19:52 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Wed, 12 Dec 2012 14:38:08 +0000 (15:38 +0100)
When switching to metric-style transition, circuit metrics should also be
verified to be in the narrow range 0..63.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
isisd/isisd.c

index 28cd0519948086abe548a54d2f1a1fac3faf5e04..ce6a26214e511e89dbd7868589386ba0ff0730af 100644 (file)
@@ -2092,19 +2092,22 @@ DEFUN (metric_style,
       area->newmetric = 1;
       area->oldmetric = 0;
     }
-  else if (strncmp (argv[0], "t", 1) == 0)
-    {
-      area->newmetric = 1;
-      area->oldmetric = 1;
-    }
-  else if (strncmp (argv[0], "n", 1) == 0)
+  else
     {
       ret = validate_metric_style_narrow (vty, area);
       if (ret != CMD_SUCCESS)
         return ret;
 
-      area->newmetric = 0;
-      area->oldmetric = 1;
+      if (strncmp (argv[0], "t", 1) == 0)
+       {
+         area->newmetric = 1;
+         area->oldmetric = 1;
+       }
+      else if (strncmp (argv[0], "n", 1) == 0)
+       {
+         area->newmetric = 0;
+         area->oldmetric = 1;
+       }
     }
 
   return CMD_SUCCESS;