aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_vlan.c
diff options
context:
space:
mode:
authorAndrew Thompson <thompsa@FreeBSD.org>2010-01-19 04:29:42 +0000
committerAndrew Thompson <thompsa@FreeBSD.org>2010-01-19 04:29:42 +0000
commit6117727b6c9d09ccca0bae1aa013997b31f3bc19 (patch)
treeb287567f4fbfe67f40621b2f3b9bfcb8c1f80cba /sys/net/if_vlan.c
parentcc5abe58cefc6d082ec9802853b72a4ec92ee321 (diff)
downloadsrc-6117727b6c9d09ccca0bae1aa013997b31f3bc19.tar.gz
src-6117727b6c9d09ccca0bae1aa013997b31f3bc19.zip
Do not hold the lock over if_setlladdr() as it calls into the interface driver
init routine.
Notes
Notes: svn path=/head/; revision=202611
Diffstat (limited to 'sys/net/if_vlan.c')
-rw-r--r--sys/net/if_vlan.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 84edf1b538ca..4b16a9ca1ae7 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -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 ifnet *ifp)
*/
#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();
}