Commit ad959e76 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

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: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94b05952
...@@ -1664,11 +1664,9 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq) ...@@ -1664,11 +1664,9 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq)
if (--ml->count == 0) { if (--ml->count == 0) {
struct net_device *dev; struct net_device *dev;
*mlp = ml->next; *mlp = ml->next;
dev = dev_get_by_index(sock_net(sk), ml->ifindex); dev = __dev_get_by_index(sock_net(sk), ml->ifindex);
if (dev) { if (dev)
packet_dev_mc(dev, ml, -1); packet_dev_mc(dev, ml, -1);
dev_put(dev);
}
kfree(ml); kfree(ml);
} }
rtnl_unlock(); rtnl_unlock();
...@@ -1692,11 +1690,9 @@ static void packet_flush_mclist(struct sock *sk) ...@@ -1692,11 +1690,9 @@ static void packet_flush_mclist(struct sock *sk)
struct net_device *dev; struct net_device *dev;
po->mclist = ml->next; po->mclist = ml->next;
dev = dev_get_by_index(sock_net(sk), ml->ifindex); dev = __dev_get_by_index(sock_net(sk), ml->ifindex);
if (dev != NULL) { if (dev != NULL)
packet_dev_mc(dev, ml, -1); packet_dev_mc(dev, ml, -1);
dev_put(dev);
}
kfree(ml); kfree(ml);
} }
rtnl_unlock(); rtnl_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment