diff options
Diffstat (limited to 'isisd/isis_zebra.c')
| -rw-r--r-- | isisd/isis_zebra.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 15b51589ae..9ed868e795 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -85,9 +85,12 @@ static int isis_router_id_update_zebra(ZAPI_CALLBACK_ARGS) static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS) { + struct isis_circuit *circuit; struct connected *c; +#ifdef EXTREME_DEBUG struct prefix *p; char buf[PREFIX2STR_BUFFER]; +#endif /* EXTREME_DEBUG */ c = zebra_interface_address_read(ZEBRA_INTERFACE_ADDRESS_ADD, zclient->ibuf, vrf_id); @@ -95,25 +98,29 @@ static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS) if (c == NULL) return 0; +#ifdef EXTREME_DEBUG p = c->address; - prefix2str(p, buf, sizeof(buf)); -#ifdef EXTREME_DEBUG + if (p->family == AF_INET) zlog_debug("connected IP address %s", buf); if (p->family == AF_INET6) zlog_debug("connected IPv6 address %s", buf); #endif /* EXTREME_DEBUG */ - if (if_is_operative(c->ifp)) - isis_circuit_add_addr(circuit_scan_by_ifp(c->ifp), c); + + if (if_is_operative(c->ifp)) { + circuit = circuit_scan_by_ifp(c->ifp); + if (circuit) + isis_circuit_add_addr(circuit, c); + } return 0; } static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS) { + struct isis_circuit *circuit; struct connected *c; - struct interface *ifp; #ifdef EXTREME_DEBUG struct prefix *p; char buf[PREFIX2STR_BUFFER]; @@ -125,8 +132,6 @@ static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS) if (c == NULL) return 0; - ifp = c->ifp; - #ifdef EXTREME_DEBUG p = c->address; prefix2str(p, buf, sizeof(buf)); @@ -137,8 +142,12 @@ static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS) zlog_debug("disconnected IPv6 address %s", buf); #endif /* EXTREME_DEBUG */ - if (if_is_operative(ifp)) - isis_circuit_del_addr(circuit_scan_by_ifp(ifp), c); + if (if_is_operative(c->ifp)) { + circuit = circuit_scan_by_ifp(c->ifp); + if (circuit) + isis_circuit_del_addr(circuit, c); + } + connected_free(&c); return 0; |
