summaryrefslogtreecommitdiffstats
path: root/net/ipv4/igmp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-10 16:34:38 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-10 16:37:26 -0800
commitdbdd9a52e38a4a93adfa4d0278801cce4fad98eb (patch)
treea223ba84f33976b0d2c17d3177cbe976a3c948fc /net/ipv4/igmp.c
parent33175d84ee3fa29991adb80513683e010769e807 (diff)
ipv4: Remove redundant RCU locking in ip_check_mc().
All callers are under rcu_read_lock() protection already. Rename to ip_check_mc_rcu() to make it even more clear. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/igmp.c')
-rw-r--r--net/ipv4/igmp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 44ba9068b72..12b65ccca8e 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2333,13 +2333,13 @@ void ip_mc_drop_socket(struct sock *sk)
rtnl_unlock();
}
-int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto)
+/* called with rcu_read_lock() */
+int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 proto)
{
struct ip_mc_list *im;
struct ip_sf_list *psf;
int rv = 0;
- rcu_read_lock();
for_each_pmc_rcu(in_dev, im) {
if (im->multiaddr == mc_addr)
break;
@@ -2361,7 +2361,6 @@ int ip_check_mc(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u16 p
} else
rv = 1; /* unspecified source; tentatively allow */
}
- rcu_read_unlock();
return rv;
}