summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2012-11-14 06:51:04 +0400
committerDavid S. Miller <davem@davemloft.net>2012-11-16 02:57:53 +0400
commita652208e0b52c190e57f2a075ffb5e897fe31c3b (patch)
tree7d41ac0aa041beb5803654d79c9893b651644f63 /net/core
parentec34232575083fd0f43d3a101e8ebb041b203761 (diff)
downloadlinux-a652208e0b52c190e57f2a075ffb5e897fe31c3b.tar.xz
net: correct check in dev_addr_del()
Check (ha->addr == dev->dev_addr) is always true because dev_addr_init() sets this. Correct the check to behave properly on addr removal. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev_addr_lists.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 87cc17db2d56..b079c7bbc157 100644
--- a/net/core/dev_addr_lists.c
+++ b/net/core/dev_addr_lists.c
@@ -319,7 +319,8 @@ int dev_addr_del(struct net_device *dev, const unsigned char *addr,
*/
ha = list_first_entry(&dev->dev_addrs.list,
struct netdev_hw_addr, list);
- if (ha->addr == dev->dev_addr && ha->refcount == 1)
+ if (!memcmp(ha->addr, addr, dev->addr_len) &&
+ ha->type == addr_type && ha->refcount == 1)
return -ENOENT;
err = __hw_addr_del(&dev->dev_addrs, addr, dev->addr_len,