diff options
author | paul <paul> | 2005-07-29 14:36:00 +0000 |
---|---|---|
committer | paul <paul> | 2005-07-29 14:36:00 +0000 |
commit | 6eb8827d669b06d7b38357860d23fa33e0c0078e (patch) | |
tree | bab69ac40c857fd6a6e7b447166df7e9ae08989d /zebra/kernel_socket.c | |
parent | 7907c6c9d34a4f19dd7d4d8d81c3c8ae5000ee07 (diff) |
2005-07-29 Paul Jakma <paul.jakma@sun.com>
* interface.c: (if_delete_update) should always be available, not
just on RTM_IFANNOUNCE/NETLINK systems.
* kernel_socket.c: (ifan_read) only call if_delete_update when
interface departs, dont if_delete, because we wish to retain
interface configuration state even when interfaces are removed.
(ifm_read) If we dont have RTM_IFANNOUNCE, then transitioning
to down state is only chance we have to clean up interface in case
it is deleted (eg Solaris down -> unplumb -> plumb up).
* redistribute.c: (zebra_interface_delete_update) should always be
available, we /will/ call it now on all systems, via
if_delete_update.
* zserv.c: (zsend_interface_delete) ditto
(zsend_interface_address) Update the call-flow diagramme, to
reflect that if_delete_update /is/ now called on all systems,
potentially.
* zserv.h: (zsend_interface_delete) unconditionally exported, as
above.
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r-- | zebra/kernel_socket.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index a27bebde..b2985c9d 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -227,10 +227,7 @@ ifan_read (struct if_announcemsghdr *ifan) if_add_update (ifp); } else if (ifp != NULL && ifan->ifan_what == IFAN_DEPARTURE) - { - if_delete_update (ifp); - if_delete (ifp); - } + if_delete_update (ifp); if_get_flags (ifp); if_get_mtu (ifp); @@ -397,7 +394,21 @@ ifm_read (struct if_msghdr *ifm) { ifp->flags = ifm->ifm_flags; if (! if_is_up (ifp)) - if_down (ifp); + { + if_down (ifp); +#ifndef RTM_IFANNOUNCE + /* No RTM_IFANNOUNCE on this platform, so we can never + * distinguish between down and delete. We must presume + * it has been deleted. + * Eg, Solaris will not notify us of unplumb. + * + * XXX: Fixme - this should be runtime detected + * So that a binary compiled on a system with IFANNOUNCE + * will still behave correctly if run on a platform without + */ + if_delete_update (ifp); +#endif /* RTM_IFANNOUNCE */ + } } else { |