mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
net: correct check in dev_addr_del()
[ Upstream commit a652208e0b ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
db4bf38b4b
commit
c5d6a96676
|
|
@ -307,7 +307,8 @@ int dev_addr_del(struct net_device *dev, 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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user