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>
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index 85a682d..da0b57a 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -1229,7 +1229,8 @@
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;
}
diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c
index f9b96a4..4148eb5 100644
--- a/isisd/isis_vty.c
+++ b/isisd/isis_vty.c
@@ -86,9 +86,16 @@
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;