Skip to content

Commit

Permalink
net: correct check in dev_addr_del()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 15, 2012
1 parent ec34232 commit a652208
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/core/dev_addr_lists.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a652208

Please sign in to comment.