From owner-svn-src-all@FreeBSD.ORG Tue Jan 19 04:29:43 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 24F7A1065679; Tue, 19 Jan 2010 04:29:43 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 153048FC12; Tue, 19 Jan 2010 04:29:43 +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 o0J4Tg1G076488; Tue, 19 Jan 2010 04:29:42 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0J4TgTR076487; Tue, 19 Jan 2010 04:29:42 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201001190429.o0J4TgTR076487@svn.freebsd.org> From: Andrew Thompson Date: Tue, 19 Jan 2010 04:29:42 +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: r202611 - head/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: Tue, 19 Jan 2010 04:29:43 -0000 Author: thompsa Date: Tue Jan 19 04:29:42 2010 New Revision: 202611 URL: http://svn.freebsd.org/changeset/base/202611 Log: Do not hold the lock over if_setlladdr() as it calls into the interface driver init routine. Modified: head/sys/net/if_vlan.c Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Jan 19 01:33:56 2010 (r202610) +++ head/sys/net/if_vlan.c Tue Jan 19 04:29:42 2010 (r202611) @@ -473,6 +473,9 @@ static void vlan_iflladdr(void *arg __unused, struct ifnet *ifp) { struct ifvlan *ifv; +#ifndef VLAN_ARRAY + struct ifvlan *next; +#endif int i; /* @@ -488,13 +491,15 @@ vlan_iflladdr(void *arg __unused, struct */ #ifdef VLAN_ARRAY for (i = 0; i < VLAN_ARRAY_SIZE; i++) - if ((ifv = ifp->if_vlantrunk->vlans[i])) - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ETHER_ADDR_LEN); + if ((ifv = ifp->if_vlantrunk->vlans[i])) { #else /* VLAN_ARRAY */ for (i = 0; i < (1 << ifp->if_vlantrunk->hwidth); i++) - LIST_FOREACH(ifv, &ifp->if_vlantrunk->hash[i], ifv_list) - if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ETHER_ADDR_LEN); + LIST_FOREACH_SAFE(ifv, &ifp->if_vlantrunk->hash[i], ifv_list, next) { #endif /* VLAN_ARRAY */ + VLAN_UNLOCK(); + if_setlladdr(ifv->ifv_ifp, IF_LLADDR(ifp), ETHER_ADDR_LEN); + VLAN_LOCK(); + } VLAN_UNLOCK(); }