Commit 6e17d45a authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: add addr len check to dev_mc_add

Signed-off-by: default avatarJiri Pirko <jpirko@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c79c5ffd
...@@ -96,6 +96,8 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) ...@@ -96,6 +96,8 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl)
int err; int err;
netif_addr_lock_bh(dev); 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); err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl);
if (!err) if (!err)
__dev_set_rx_mode(dev); __dev_set_rx_mode(dev);
......
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