Skip to content

Commit

Permalink
net: add addr len check to dev_mc_add
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Feb 26, 2010
1 parent c79c5ff commit 6e17d45
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/core/dev_mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
int err;

netif_addr_lock_bh(dev);
if (alen != dev->addr_len)
return -EINVAL;
err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
if (!err)
__dev_set_rx_mode(dev);
Expand Down

0 comments on commit 6e17d45

Please sign in to comment.