MFC: if.c, 1.236

Move eventhandler for 'ifnet_departure_event' at the end of the progress.
  Some of the (IPv6) cleanup functions send packets to inform peers of the
  departure.  These packets confused users of ifnet_departure_event (pf at
  the moment).

  PR:             kern/80627
  Tested by:      Divacky Roman

Approved by:	re (kensmith)
This commit is contained in:
mlaier 2005-07-23 17:00:07 +00:00
parent 45ebd5c0a6
commit 54b3d10896

View File

@ -652,7 +652,6 @@ if_detach(struct ifnet *ifp)
*/
taskqueue_drain(taskqueue_swi, &ifp->if_linktask);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
#ifdef DEV_CARP
/* Maybe hook to the generalized departure handler above?!? */
if (ifp->if_carp)
@ -713,6 +712,7 @@ if_detach(struct ifnet *ifp)
/* Announce that the interface is gone. */
rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
IF_AFDATA_LOCK(ifp);
for (dp = domains; dp; dp = dp->dom_next) {
@ -1332,9 +1332,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td)
if (ifunit(new_name) != NULL)
return (EEXIST);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
/* Announce the departure of the interface. */
rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
log(LOG_INFO, "%s: changing name to '%s'\n",
ifp->if_xname, new_name);