* 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.
+ 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>
isis_circuit_update_params (struct isis_circuit *circuit,
struct interface *ifp)
{
- /* 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;
+ assert (circuit);
if (circuit->circuit_id != ifp->ifindex)
{
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);
- if (if_is_up (ifp))
+ if (if_is_operative (ifp))
isis_csm_state_change (IF_UP_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
return 0;
if (!ifp)
return 0;
- if (if_is_up (ifp))
+ if (if_is_operative (ifp))
zlog_warn ("Zebra: got delete of %s, but interface is still up",
ifp->name);
if (!ifp)
return 0;
- if (if_is_up (ifp))
+ if (if_is_operative (ifp))
{
zebra_interface_if_set_value (zclient->ibuf, ifp);
/* HT: This is wrong actually. We can't assume that circuit exist
if (ifp == NULL)
return 0;
- if (if_is_up (ifp))
+ if (if_is_operative (ifp))
{
zebra_interface_if_set_value (zclient->ibuf, ifp);
isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp);
zlog_debug ("connected IPv6 address %s", buf);
#endif /* HAVE_IPV6 */
#endif /* EXTREME_DEBUG */
- isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c);
+ if (if_is_operative (c->ifp))
+ isis_circuit_add_addr (circuit_scan_by_ifp (c->ifp), c);
return 0;
}
#endif /* HAVE_IPV6 */
#endif /* EXTREME_DEBUG */
- isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c);
+ if (if_is_operative (ifp))
+ isis_circuit_del_addr (circuit_scan_by_ifp (ifp), c);
connected_free (c);
return 0;