Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Apr 2018 08:39:23 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r333106 - stable/10/sys/net
Message-ID:  <201804300839.w3U8dN6G049898@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger
Date: Mon Apr 30 08:39:23 2018
New Revision: 333106
URL: https://svnweb.freebsd.org/changeset/base/333106

Log:
  MFC 270041:
  
  net: move interface removal notification up in if_detach_internal
  
  Requested by: dexuan

Modified:
  stable/10/sys/net/if.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/net/if.c
==============================================================================
--- stable/10/sys/net/if.c	Mon Apr 30 08:38:01 2018	(r333105)
+++ stable/10/sys/net/if.c	Mon Apr 30 08:39:23 2018	(r333106)
@@ -983,6 +983,12 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc
 #endif
 	if_purgemaddrs(ifp);
 
+	/* Announce that the interface is gone. */
+	rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
+	EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
+	if (IS_DEFAULT_VNET(curvnet))
+		devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
+
 	if (!vmove) {
 		/*
 		 * Prevent further calls into the device driver via ifnet.
@@ -1022,11 +1028,6 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc
 		}
 	}
 
-	/* Announce that the interface is gone. */
-	rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
-	EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
-	if (IS_DEFAULT_VNET(curvnet))
-		devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
 	if_delgroups(ifp);
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804300839.w3U8dN6G049898>