From owner-svn-src-head@FreeBSD.ORG Sun Apr 11 11:49:24 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E93DD106566C; Sun, 11 Apr 2010 11:49:24 +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 D74AD8FC12; Sun, 11 Apr 2010 11:49:24 +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 o3BBnOYY088192; Sun, 11 Apr 2010 11:49:24 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3BBnOOm088190; Sun, 11 Apr 2010 11:49:24 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201004111149.o3BBnOOm088190@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 11 Apr 2010 11:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206469 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Apr 2010 11:49:25 -0000 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]);