diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-08-03 19:29:47 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-08-03 19:29:47 +0000 |
commit | 7504160c1e1a408af3d9f6b998e6e9ce49dcf158 (patch) | |
tree | 7da6aeba14225658b424b8a1f07d30e9523cbc3e /sys/netinet/ip_input.c | |
parent | 405f9b654c12682dc78887f78db0d01ebe3acbdf (diff) | |
download | FreeBSD-src-7504160c1e1a408af3d9f6b998e6e9ce49dcf158.zip FreeBSD-src-7504160c1e1a408af3d9f6b998e6e9ce49dcf158.tar.gz |
Introduce in_multi_mtx, which will protect IPv4-layer multicast address
lists, as well as accessor macros. For now, this is a recursive mutex
due code sequences where IPv4 multicast calls into IGMP calls into
ip_output(), which then tests for a multicast forwarding case.
For support macros in in_var.h to check multicast address lists, assert
that in_multi_mtx is held.
Acquire in_multi_mtx around iteration over the IPv4 multicast address
lists, such as in ip_input() and ip_output().
Acquire in_multi_mtx when manipulating the IPv4 layer multicast addresses,
as well as over the manipulation of ifnet multicast address lists in order
to keep the two layers in sync.
Lock down accesses to IPv4 multicast addresses in IGMP, or assert the
lock when performing IGMP join/leave events.
Eliminate spl's associated with IPv4 multicast addresses, portions of
IGMP that weren't previously expunged by IGMP locking.
Add in_multi_mtx, igmp_mtx, and if_addr_mtx lock order to hard-coded
lock order in WITNESS, in that order.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
MFC after: 10 days
Diffstat (limited to 'sys/netinet/ip_input.c')
-rw-r--r-- | sys/netinet/ip_input.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index ff4b4be..eb42a4d 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -607,7 +607,9 @@ passin: * See if we belong to the destination multicast group on the * arrival interface. */ + IN_MULTI_LOCK(); IN_LOOKUP_MULTI(ip->ip_dst, m->m_pkthdr.rcvif, inm); + IN_MULTI_UNLOCK(); if (inm == NULL) { ipstat.ips_notmember++; m_freem(m); |