svn commit: r206469 - head/sys/net
Bjoern A. Zeeb
bz at FreeBSD.org
Sun Apr 11 11:49:25 UTC 2010
Author: bz
Date: Sun Apr 11 11:49:24 2010
New Revision: 206469
URL: http://svn.freebsd.org/changeset/base/206469
Log:
In if_detach_internal() only try to do the detach run if if_attachdomain1()
has actually succeeded to initialize and attach. There is a theoretical
possibility to drop out early in if_attachdomain1() leaving the array
uninitialized if we cannot get the lock.
Discussed with: rwatson
MFC after: 10 days
Modified:
head/sys/net/if.c
Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c Sun Apr 11 11:27:19 2010 (r206468)
+++ head/sys/net/if.c Sun Apr 11 11:49:24 2010 (r206469)
@@ -898,7 +898,7 @@ if_detach_internal(struct ifnet *ifp, in
if_delgroups(ifp);
IF_AFDATA_LOCK(ifp);
- for (dp = domains; dp; dp = dp->dom_next) {
+ for (dp = domains; ifp->if_afdata_initialized > 0 && dp; dp = dp->dom_next) {
if (dp->dom_ifdetach && ifp->if_afdata[dp->dom_family])
(*dp->dom_ifdetach)(ifp,
ifp->if_afdata[dp->dom_family]);
More information about the svn-src-all
mailing list