summaryrefslogtreecommitdiffstats
path: root/sys/dev/gem
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-08-03 00:18:35 +0000
committerrwatson <rwatson@FreeBSD.org>2005-08-03 00:18:35 +0000
commit9918d13b80941400bfab87834b1e2f1eea58c7c7 (patch)
tree9a4e586ffbcd1450917ee5e388a4e1eb38254e32 /sys/dev/gem
parentefa13b9da9fc80838e2c73140ae27393b3660da4 (diff)
downloadFreeBSD-src-9918d13b80941400bfab87834b1e2f1eea58c7c7.zip
FreeBSD-src-9918d13b80941400bfab87834b1e2f1eea58c7c7.tar.gz
Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list. Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week
Diffstat (limited to 'sys/dev/gem')
-rw-r--r--sys/dev/gem/if_gem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c
index f669903..900af18 100644
--- a/sys/dev/gem/if_gem.c
+++ b/sys/dev/gem/if_gem.c
@@ -1954,6 +1954,7 @@ gem_setladrf(sc)
/* Clear hash table */
memset(hash, 0, sizeof(hash));
+ IF_ADDR_LOCK(ifp);
TAILQ_FOREACH(inm, &ifp->if_multiaddrs, ifma_link) {
if (inm->ifma_addr->sa_family != AF_LINK)
continue;
@@ -1966,6 +1967,7 @@ gem_setladrf(sc)
/* Set the corresponding bit in the filter. */
hash[crc >> 4] |= 1 << (15 - (crc & 15));
}
+ IF_ADDR_UNLOCK(ifp);
v |= GEM_MAC_RX_HASH_FILTER;
ifp->if_flags &= ~IFF_ALLMULTI;
OpenPOWER on IntegriCloud