isisd: fix a crash due to an lsp-mtu issue
isisd crashed on startup if it was enabled for an interface with
a too small MTU.
To fix this, we treat this case as an invalid configuration and
disable isis on that interface if that case happens, since it is
a configuration error.
Signed-off-by: Christian Franke <nobody@nowhere.ws>
diff --git a/isisd/isis_csm.c b/isisd/isis_csm.c
index a58ba49..0f642a7 100644
--- a/isisd/isis_csm.c
+++ b/isisd/isis_csm.c
@@ -147,10 +147,27 @@
case IF_UP_FROM_Z:
isis_circuit_if_add (circuit, (struct interface *) arg);
if (isis_circuit_up (circuit) != ISIS_OK)
- {
- isis_circuit_if_del (circuit, (struct interface *) arg);
+ {
+ zlog_err("Could not bring up %s because of invalid config.",
+ circuit->interface->name);
+ zlog_err("Clearing config for %s. Please re-examine it.",
+ circuit->interface->name);
+ if (circuit->ip_router)
+ {
+ circuit->ip_router = 0;
+ circuit->area->ip_circuits--;
+ }
+ if (circuit->ipv6_router)
+ {
+ circuit->ipv6_router = 0;
+ circuit->area->ipv6_circuits--;
+ }
+ circuit_update_nlpids(circuit);
+ isis_circuit_deconfigure(circuit, circuit->area);
+ listnode_add (isis->init_circ_list, circuit);
+ circuit->state = C_STATE_INIT;
break;
- }
+ }
circuit->state = C_STATE_UP;
isis_event_circuit_state_change (circuit, circuit->area, 1);
break;