]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: ensure that MT is only used with wide metrics
authorChristian Franke <chris@opensourcerouting.org>
Sat, 6 May 2017 13:50:41 +0000 (15:50 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Sat, 6 May 2017 13:50:41 +0000 (15:50 +0200)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/isis_vty.c
isisd/isisd.c

index 1658ca3733c90a78dffbd6547c2b046d9ea87426..9cae5f9a5c449995669e38a897383ec582eea68b 100644 (file)
@@ -1284,6 +1284,13 @@ DEFUN (circuit_topology,
     return CMD_ERR_NO_MATCH;
   const char *arg = argv[2]->arg;
   uint16_t mtid = isis_str2mtid(arg);
+
+  if (circuit->area && circuit->area->oldmetric)
+    {
+      vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   if (mtid == (uint16_t)-1)
     {
       vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE);
@@ -1306,6 +1313,13 @@ DEFUN (no_circuit_topology,
     return CMD_ERR_NO_MATCH;
   const char *arg = argv[3]->arg;
   uint16_t mtid = isis_str2mtid(arg);
+
+  if (circuit->area && circuit->area->oldmetric)
+    {
+      vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   if (mtid == (uint16_t)-1)
     {
       vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE);
@@ -1371,6 +1385,12 @@ DEFUN (metric_style,
       return CMD_SUCCESS;
     }
 
+  if (area_is_mt(area))
+    {
+      vty_out (vty, "Narrow metrics cannot be used while multi topology IS-IS is active%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   ret = validate_metric_style_narrow (vty, area);
   if (ret != CMD_SUCCESS)
     return ret;
@@ -1393,6 +1413,12 @@ DEFUN (no_metric_style,
   VTY_DECLVAR_CONTEXT (isis_area, area);
   int ret;
 
+  if (area_is_mt(area))
+    {
+      vty_out (vty, "Narrow metrics cannot be used while multi topology IS-IS is active%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   ret = validate_metric_style_narrow (vty, area);
   if (ret != CMD_SUCCESS)
     return ret;
index 179e4309868401fffcaca05ee4d4ddab9db26cab..d11044377f4d534c13cc10697ed2baea04db63c6 100644 (file)
@@ -1669,6 +1669,13 @@ DEFUN (isis_topology,
 
   const char *arg = argv[1]->arg;
   uint16_t mtid = isis_str2mtid(arg);
+
+  if (area->oldmetric)
+    {
+      vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   if (mtid == (uint16_t)-1)
     {
       vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE);
@@ -1697,6 +1704,13 @@ DEFUN (no_isis_topology,
 
   const char *arg = argv[2]->arg;
   uint16_t mtid = isis_str2mtid(arg);
+
+  if (area->oldmetric)
+    {
+      vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE);
+      return CMD_ERR_AMBIGUOUS;
+    }
+
   if (mtid == (uint16_t)-1)
     {
       vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE);