aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2012-11-13 21:51:04 -0500
committerDavid S. Miller <davem@davemloft.net>2012-11-15 17:57:53 -0500
commita652208e0b52c190e57f2a075ffb5e897fe31c3b (patch)
tree7d41ac0aa041beb5803654d79c9893b651644f63
parentec34232575083fd0f43d3a101e8ebb041b203761 (diff)
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>
-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,
319 */ 319 */
320 ha = list_first_entry(&dev->dev_addrs.list, 320 ha = list_first_entry(&dev->dev_addrs.list,
321 struct netdev_hw_addr, list); 321 struct netdev_hw_addr, list);
322 if (ha->addr == dev->dev_addr && ha->refcount == 1) 322 if (!memcmp(ha->addr, addr, dev->addr_len) &&
323 ha->type == addr_type && ha->refcount == 1)
323 return -ENOENT; 324 return -ENOENT;
324 325
325 err = __hw_addr_del(&dev->dev_addrs, addr, dev->addr_len, 326 err = __hw_addr_del(&dev->dev_addrs, addr, dev->addr_len,