diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-06-26 11:45:06 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-06-26 11:45:06 +0000 |
commit | be5740a255fbcb1d4053e709cb7f22bb96320eb0 (patch) | |
tree | 30aee113c454323f30d4c201e18a0f29e2938074 /sys/netgraph | |
parent | ffea8e20279ff0d82924add1cef0d8e16d9538a5 (diff) | |
download | FreeBSD-src-be5740a255fbcb1d4053e709cb7f22bb96320eb0.zip FreeBSD-src-be5740a255fbcb1d4053e709cb7f22bb96320eb0.tar.gz |
Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
IF_ADDR_UNLOCK() across network device drivers when accessing the
per-interface multicast address list, if_multiaddrs. This will
allow us to change the locking strategy without affecting our driver
programming interface or binary interface.
For two wireless drivers, remove unnecessary locking, since they
don't actually access the multicast address list.
Approved by: re (kib)
MFC after: 6 weeks
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_ether.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netgraph/ng_ether.c b/sys/netgraph/ng_ether.c index 5f22f17..2be3b883 100644 --- a/sys/netgraph/ng_ether.c +++ b/sys/netgraph/ng_ether.c @@ -551,10 +551,10 @@ ng_ether_rcvmsg(node_p node, item_p item, hook_p lasthook) * lose a race while we check if the membership * already exists. */ - IF_ADDR_LOCK(priv->ifp); + if_maddr_rlock(priv->ifp); ifma = if_findmulti(priv->ifp, (struct sockaddr *)&sa_dl); - IF_ADDR_UNLOCK(priv->ifp); + if_maddr_runlock(priv->ifp); if (ifma != NULL) { error = EADDRINUSE; } else { |