Browse Source

isisd: warn if there is an MTU issue on circuits

Instead of later tripping over an assert, add a proper warning for
interfaces whose MTU is too low.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Christian Franke 3 years ago
parent
commit
af177b245e
2 changed files with 10 additions and 2 deletions
  1. 2 1
      isisd/isis_circuit.c
  2. 8 1
      isisd/isis_vty.c

+ 2 - 1
isisd/isis_circuit.c

@@ -1229,7 +1229,8 @@ isis_circuit_create (struct isis_area *area, struct interface *ifp)
   if (circuit && circuit->area)
     return NULL;
   circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area);
-  assert (circuit->state == C_STATE_CONF || circuit->state == C_STATE_UP);
+  if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
+    return circuit;
   isis_circuit_if_bind (circuit, ifp);
   return circuit;
 }

+ 8 - 1
isisd/isis_vty.c

@@ -86,9 +86,16 @@ DEFUN (ip_router_isis,
   if (!area)
     area = isis_area_create (area_tag);
 
-  if (!circuit || !circuit->area)
+  if (!circuit || !circuit->area) {
     circuit = isis_circuit_create (area, ifp);
 
+    if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
+      {
+        vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE);
+        return CMD_WARNING;
+      }
+  }
+
   bool ip = circuit->ip_router, ipv6 = circuit->ipv6_router;
   if (af[2] != '\0')
     ipv6 = true;