Really fix crashes now. Revert isis_circuit_update_params() part of previous

commit. Replace all if_is_up() calls with if_is_operative().
This commit is contained in:
hasso 2004-12-29 20:06:41 +00:00
parent d44debedf5
commit b30c5e67a2
3 changed files with 11 additions and 13 deletions

View File

@ -2,7 +2,8 @@
* isis_circuit.c, isis_csm.c, isis_zebra.c: Don't crash during * 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 interface up/down events. I'm not sure whether logic is correct
though. Needs rethink anyway, seems. though. Needs rethink anyway, seems. Replace if_is_up() with
if_is_operative() and add some more.
2004-12-24 Hasso Tepper <hasso at quagga.net> 2004-12-24 Hasso Tepper <hasso at quagga.net>

View File

@ -430,12 +430,7 @@ void
isis_circuit_update_params (struct isis_circuit *circuit, isis_circuit_update_params (struct isis_circuit *circuit,
struct interface *ifp) struct interface *ifp)
{ {
/* HT: It can happen at the moment during interface up event because we assert (circuit);
* actually delete circuit during interface down event. Should be really
* cleaned up. TODO */
/* assert (circuit); */
if (!circuit)
return;
if (circuit->circuit_id != ifp->ifindex) if (circuit->circuit_id != ifp->ifindex)
{ {

View File

@ -70,7 +70,7 @@ isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length)
zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d", zlog_debug ("Zebra I/F add: %s index %d flags %ld metric %d mtu %d",
ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
if (if_is_up (ifp)) if (if_is_operative (ifp))
isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp); isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
return 0; return 0;
@ -88,7 +88,7 @@ isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length)
if (!ifp) if (!ifp)
return 0; return 0;
if (if_is_up (ifp)) if (if_is_operative (ifp))
zlog_warn ("Zebra: got delete of %s, but interface is still up", zlog_warn ("Zebra: got delete of %s, but interface is still up",
ifp->name); ifp->name);
@ -132,7 +132,7 @@ isis_zebra_if_state_up (int command, struct zclient *zclient,
if (!ifp) if (!ifp)
return 0; return 0;
if (if_is_up (ifp)) if (if_is_operative (ifp))
{ {
zebra_interface_if_set_value (zclient->ibuf, ifp); zebra_interface_if_set_value (zclient->ibuf, ifp);
/* HT: This is wrong actually. We can't assume that circuit exist /* HT: This is wrong actually. We can't assume that circuit exist
@ -159,7 +159,7 @@ isis_zebra_if_state_down (int command, struct zclient *zclient,
if (ifp == NULL) if (ifp == NULL)
return 0; return 0;
if (if_is_up (ifp)) if (if_is_operative (ifp))
{ {
zebra_interface_if_set_value (zclient->ibuf, ifp); zebra_interface_if_set_value (zclient->ibuf, ifp);
isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp); isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
@ -193,6 +193,7 @@ isis_zebra_if_address_add (int command, struct zclient *zclient,
zlog_debug ("connected IPv6 address %s", buf); zlog_debug ("connected IPv6 address %s", buf);
#endif /* HAVE_IPV6 */ #endif /* HAVE_IPV6 */
#endif /* EXTREME_DEBUG */ #endif /* EXTREME_DEBUG */
if (if_is_operative (c->ifp))
isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c); isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c);
return 0; return 0;
@ -229,6 +230,7 @@ isis_zebra_if_address_del (int command, struct zclient *client,
#endif /* HAVE_IPV6 */ #endif /* HAVE_IPV6 */
#endif /* EXTREME_DEBUG */ #endif /* EXTREME_DEBUG */
if (if_is_operative (ifp))
isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c); isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c);
connected_free (c); connected_free (c);