aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-09 23:38:02 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-09 23:38:02 -0400
commit3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (patch)
tree02e95f15bd8a04071a9a36f534a92a066a8ce66a /net/packet
parent8ac467e837a24eb024177b4b01013d8e6764913a (diff)
parentaffb8172de395a6e1db52ed9790ca0456d8c29a9 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/cadence/macb.c Overlapping changes in macb driver, mostly fixes and cleanups in 'net' overlapping with the integration of at91_ether into macb in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/packet')
-rw-r--r--net/packet/af_packet.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 8167aecc1594..b91ac5946ad1 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -3139,11 +3139,18 @@ static int packet_dev_mc(struct net_device *dev, struct packet_mclist *i,
3139 return 0; 3139 return 0;
3140} 3140}
3141 3141
3142static void packet_dev_mclist(struct net_device *dev, struct packet_mclist *i, int what) 3142static void packet_dev_mclist_delete(struct net_device *dev,
3143 struct packet_mclist **mlp)
3143{ 3144{
3144 for ( ; i; i = i->next) { 3145 struct packet_mclist *ml;
3145 if (i->ifindex == dev->ifindex) 3146
3146 packet_dev_mc(dev, i, what); 3147 while ((ml = *mlp) != NULL) {
3148 if (ml->ifindex == dev->ifindex) {
3149 packet_dev_mc(dev, ml, -1);
3150 *mlp = ml->next;
3151 kfree(ml);
3152 } else
3153 mlp = &ml->next;
3147 } 3154 }
3148} 3155}
3149 3156
@@ -3220,12 +3227,11 @@ static int packet_mc_drop(struct sock *sk, struct packet_mreq_max *mreq)
3220 packet_dev_mc(dev, ml, -1); 3227 packet_dev_mc(dev, ml, -1);
3221 kfree(ml); 3228 kfree(ml);
3222 } 3229 }
3223 rtnl_unlock(); 3230 break;
3224 return 0;
3225 } 3231 }
3226 } 3232 }
3227 rtnl_unlock(); 3233 rtnl_unlock();
3228 return -EADDRNOTAVAIL; 3234 return 0;
3229} 3235}
3230 3236
3231static void packet_flush_mclist(struct sock *sk) 3237static void packet_flush_mclist(struct sock *sk)
@@ -3575,7 +3581,7 @@ static int packet_notifier(struct notifier_block *this,
3575 switch (msg) { 3581 switch (msg) {
3576 case NETDEV_UNREGISTER: 3582 case NETDEV_UNREGISTER:
3577 if (po->mclist) 3583 if (po->mclist)
3578 packet_dev_mclist(dev, po->mclist, -1); 3584 packet_dev_mclist_delete(dev, &po->mclist);
3579 /* fallthrough */ 3585 /* fallthrough */
3580 3586
3581 case NETDEV_DOWN: 3587 case NETDEV_DOWN: