Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2010 19:47:19 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r207011 - stable/8/sys/net
Message-ID:  <201004211947.o3LJlJTI050413@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Wed Apr 21 19:47:19 2010
New Revision: 207011
URL: http://svn.freebsd.org/changeset/base/207011

Log:
  MFC r206469:
  
    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

Modified:
  stable/8/sys/net/if.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/geom/sched/   (props changed)

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c	Wed Apr 21 19:45:41 2010	(r207010)
+++ stable/8/sys/net/if.c	Wed Apr 21 19:47:19 2010	(r207011)
@@ -931,7 +931,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?201004211947.o3LJlJTI050413>