Netdev List
 help / color / mirror / Atom feed
* [patch net] net: correct check in dev_addr_del()
@ 2012-11-14 12:51 Jiri Pirko
  2012-11-14 14:18 ` Eric Dumazet
  2012-11-15  2:52 ` David Miller
  0 siblings, 2 replies; 9+ messages in thread
From: Jiri Pirko @ 2012-11-14 12:51 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, shemminger, john.r.fastabend

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>
---
 net/core/dev_addr_lists.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/core/dev_addr_lists.c b/net/core/dev_addr_lists.c
index 87cc17d..b079c7b 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,
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-12 20:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-14 12:51 [patch net] net: correct check in dev_addr_del() Jiri Pirko
2012-11-14 14:18 ` Eric Dumazet
2012-11-14 14:29   ` Jiri Pirko
2012-11-14 14:38     ` Eric Dumazet
2012-11-14 15:22       ` Jiri Pirko
2013-01-12 20:39       ` Jan Engelhardt
2012-11-15  2:52 ` David Miller
2012-11-15 10:12   ` Jiri Pirko
2012-11-15 22:58     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox