Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2010 11:49:24 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r206469 - head/sys/net
Message-ID:  <201004111149.o3BBnOOm088190@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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]);



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