Browse Source

isisd: verify metrics on metric-style transition

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>
Christian Franke 8 years ago
parent
commit
478c1125cf
1 changed files with 11 additions and 8 deletions
  1. 11 8
      isisd/isisd.c

+ 11 - 8
isisd/isisd.c

@@ -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;