]> git.puffer.fish Git - matthieu/frr.git/commitdiff
isisd: fix a crash due to an lsp-mtu issue
authorChristian Franke <nobody@nowhere.ws>
Sun, 3 Apr 2016 15:46:26 +0000 (12:46 -0300)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Apr 2016 12:06:42 +0000 (08:06 -0400)
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>
isisd/isis_circuit.c
isisd/isis_csm.c

index a942f2d58107632ada60e4559e44ddb954523956..84b8cec565e8f036f1038d33c0d2cb28762cf101 100644 (file)
@@ -636,7 +636,7 @@ isis_circuit_up (struct isis_circuit *circuit)
       zlog_err("Interface MTU %zu on %s is too low to support area lsp mtu %u!",
                isis_circuit_pdu_size(circuit), circuit->interface->name,
                circuit->area->lsp_mtu);
-      isis_circuit_down(circuit);
+      isis_circuit_update_all_srmflags(circuit, 0);
       return ISIS_ERROR;
     }
 
index a58ba49072354a886643ed57ff153dfcd15d0f06..0f642a777880abba10af8e5b5f4714ce498f38ff 100644 (file)
@@ -147,10 +147,27 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
        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;