diff options
author | Jiri Pirko <jpirko@redhat.com> | 2010-02-24 17:49:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-26 07:22:26 -0500 |
commit | 6e17d45ae310758ab30623a42ad070858c9a48de (patch) | |
tree | bbb23cc9b757a38fcc953f0c862e5ec4b868568e /net | |
parent | c79c5ffdce14abb4de3878c5aa8c3c6e5093c69b (diff) |
net: add addr len check to dev_mc_add
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/core/dev_mcast.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/dev_mcast.c b/net/core/dev_mcast.c index 9e2fa39f22a3..fd91569e2394 100644 --- a/net/core/dev_mcast.c +++ b/net/core/dev_mcast.c | |||
@@ -96,6 +96,8 @@ int dev_mc_add(struct net_device *dev, void *addr, int alen, int glbl) | |||
96 | int err; | 96 | int err; |
97 | 97 | ||
98 | netif_addr_lock_bh(dev); | 98 | netif_addr_lock_bh(dev); |
99 | if (alen != dev->addr_len) | ||
100 | return -EINVAL; | ||
99 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); | 101 | err = __dev_addr_add(&dev->mc_list, &dev->mc_count, addr, alen, glbl); |
100 | if (!err) | 102 | if (!err) |
101 | __dev_set_rx_mode(dev); | 103 | __dev_set_rx_mode(dev); |