From owner-svn-src-all@FreeBSD.ORG Wed Apr 21 19:47:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81D601065673; Wed, 21 Apr 2010 19:47:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70B378FC0C; Wed, 21 Apr 2010 19:47:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3LJlJV0050415; Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3LJlJTI050413; Wed, 21 Apr 2010 19:47:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004211947.o3LJlJTI050413@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Wed, 21 Apr 2010 19:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207011 - stable/8/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 19:47:19 -0000 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]);