diff options
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/ChangeLog | 7 | ||||
-rw-r--r-- | isisd/isis_zebra.c | 18 |
2 files changed, 15 insertions, 10 deletions
diff --git a/isisd/ChangeLog b/isisd/ChangeLog index d7fadd0c..6f4f3958 100644 --- a/isisd/ChangeLog +++ b/isisd/ChangeLog @@ -1,3 +1,10 @@ +2005-04-02 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * isis_zebra.c: (isis_zebra_if_del) Call if_delete_retain instead + of if_delete, since it is generally not safe to remove interface + structures. After deleting, set ifp->ifindex to IFINDEX_INTERNAL. + (zebra_interface_if_lookup) Tighten up code. + 2005-03-07 Michael Sandee <voidptr@voidptr.sboost.org> * isis_spf.c: host.name might be NULL. diff --git a/isisd/isis_zebra.c b/isisd/isis_zebra.c index 40743b29..0f8d1162 100644 --- a/isisd/isis_zebra.c +++ b/isisd/isis_zebra.c @@ -95,30 +95,28 @@ isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length) zlog_debug ("Zebra I/F delete: %s index %d flags %ld metric %d mtu %d", ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu); - if_delete (ifp); + + /* Cannot call if_delete because we should retain the pseudo interface + in case there is configuration info attached to it. */ + if_delete_retain(ifp); isis_csm_state_change (IF_DOWN_FROM_Z, circuit_scan_by_ifp (ifp), ifp); + ifp->ifindex = IFINDEX_INTERNAL; + return 0; } static struct interface * zebra_interface_if_lookup (struct stream *s) { - struct interface *ifp; u_char ifname_tmp[INTERFACE_NAMSIZ]; /* Read interface name. */ stream_get (ifname_tmp, s, INTERFACE_NAMSIZ); - /* Lookup this by interface index. */ - ifp = if_lookup_by_name ((char *) ifname_tmp); - - /* If such interface does not exist, indicate an error */ - if (!ifp) - return NULL; - - return ifp; + /* And look it up. */ + return if_lookup_by_name ((char *) ifname_tmp); } static int |