diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2009-10-16 06:38:46 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-20 01:02:06 -0700 |
commit | ad959e76f0fa94d299a8c25cb45de4d1b845e9ce (patch) | |
tree | fb073c78ce30a020d5b0bb75ac459af79011e991 /net/packet | |
parent | 94b059520d6c0cea852dc9a3e9033c6f123df7c1 (diff) | |
download | kernel_samsung_crespo-ad959e76f0fa94d299a8c25cb45de4d1b845e9ce.zip kernel_samsung_crespo-ad959e76f0fa94d299a8c25cb45de4d1b845e9ce.tar.gz kernel_samsung_crespo-ad959e76f0fa94d299a8c25cb45de4d1b845e9ce.tar.bz2 |
af_packet: mc_drop/flush_mclist changes
We hold RTNL, we can use __dev_get_by_index() instead of dev_get_by_index()
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index dac775e..ff752c6 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1664,11 +1664,9 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq) if (--ml->count == 0) { struct net_device *dev; *mlp = ml->next; - dev = dev_get_by_index(sock_net(sk), ml->ifindex); - if (dev) { + dev = __dev_get_by_index(sock_net(sk), ml->ifindex); + if (dev) packet_dev_mc(dev, ml, -1); - dev_put(dev); - } kfree(ml); } rtnl_unlock(); @@ -1692,11 +1690,9 @@ static void packet_flush_mclist(struct sock *sk) struct net_device *dev; po->mclist = ml->next; - dev = dev_get_by_index(sock_net(sk), ml->ifindex); - if (dev != NULL) { + dev = __dev_get_by_index(sock_net(sk), ml->ifindex); + if (dev != NULL) packet_dev_mc(dev, ml, -1); - dev_put(dev); - } kfree(ml); } rtnl_unlock(); |