]> git.puffer.fish Git - mirror/frr.git/commitdiff
Don't crash during interface up/down events.
authorhasso <hasso>
Wed, 29 Dec 2004 19:34:22 +0000 (19:34 +0000)
committerhasso <hasso>
Wed, 29 Dec 2004 19:34:22 +0000 (19:34 +0000)
isisd/ChangeLog
isisd/isis_circuit.c
isisd/isis_csm.c
isisd/isis_zebra.c

index 93a901b7e3e66f5c1cabb52fdeb91c4a9c4322f5..e883faa080256c1e890a267a43177a998f5366a5 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-29 Hasso Tepper <hasso at quagga.net>
+
+       * isis_circuit.c, isis_csm.c, isis_zebra.c: Don't crash during
+         interface up/down events. I'm not sure whether logic is correct
+         though. Needs rethink anyway, seems.
+
 2004-12-24 Hasso Tepper <hasso at quagga.net>
 
        * *.c: zlog_* cleanup. Mostly changed level of debug messages to
index c00e88f83171477c4c5f4bc6a26fb40b90f6b6e6..ca5befbd9e35def2c1db4c24200421637456b30c 100644 (file)
@@ -191,8 +191,10 @@ isis_circuit_del (struct isis_circuit *circuit)
   if (circuit->circ_type == CIRCUIT_T_BROADCAST)
     {
       /* destroy adjacency databases */
-      list_delete (circuit->u.bc.adjdb[0]);
-      list_delete (circuit->u.bc.adjdb[1]);
+      if (circuit->u.bc.adjdb[0])
+       list_delete (circuit->u.bc.adjdb[0]);
+      if (circuit->u.bc.adjdb[1])
+       list_delete (circuit->u.bc.adjdb[1]);
       /* destroy neighbour lists */
       if (circuit->u.bc.lan_neighs[0])
        list_delete (circuit->u.bc.lan_neighs[0]);
@@ -428,7 +430,12 @@ void
 isis_circuit_update_params (struct isis_circuit *circuit,
                            struct interface *ifp)
 {
-  assert (circuit);
+  /* HT: It can happen at the moment during interface up event because we
+   * actually delete circuit during interface down event. Should be really
+   * cleaned up. TODO */
+  /* assert (circuit); */
+  if (!circuit)
+    return;
 
   if (circuit->circuit_id != ifp->ifindex)
     {
index 8e57d398a783c640b92a90c5c3dead6ddae43b10..58a0b295e40754a5c56dc2dae9e26fece1cbcf77 100644 (file)
@@ -125,6 +125,7 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
          isis_circuit_if_del (circuit);
          listnode_delete (isis->init_circ_list, circuit);
          isis_circuit_del (circuit);
+         circuit = NULL;
          break;
        }
       break;
@@ -143,6 +144,7 @@ isis_csm_state_change (int event, struct isis_circuit *circuit, void *arg)
        case ISIS_DISABLE:
          isis_circuit_deconfigure (circuit, (struct isis_area *) arg);
          isis_circuit_del (circuit);
+         circuit = NULL;
          break;
        case IF_DOWN_FROM_Z:
          zlog_warn ("circuit already disconnected");
index c7d05334123ef809a8630df3834dba176a01d3ff..bcd00184e5b6612f9799b5a87cde50631f92b361 100644 (file)
@@ -135,6 +135,9 @@ isis_zebra_if_state_up (int command, struct zclient *zclient,
   if (if_is_up (ifp))
     {
       zebra_interface_if_set_value (zclient->ibuf, ifp);
+      /* HT: This is wrong actually. We can't assume that circuit exist
+       * if we delete circuit during if_state_down event. Needs rethink.
+       * TODO */
       isis_circuit_update_params (circuit_scan_by_ifp (ifp), ifp);
       return 0;
     }