driver: macvlan: Check if need rollback multicast setting in macvlan_open
authorGao Feng <fgao@ikuai8.com>
Tue, 22 Nov 2016 01:54:36 +0000 (09:54 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Nov 2016 01:18:36 +0000 (20:18 -0500)
When dev_set_promiscuity failed in macvlan_open, it always invokes
dev_set_allmulti without checking if necessary.
Now check the IFF_ALLMULTI flag firstly before rollback the multicast
setting in the error handler.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvlan.c

index d2d6f12a112fcca36533c2b315f609eebda969b7..26d6f0bbe14bf9b35c778f0f3516a2e3065954b2 100644 (file)
@@ -623,7 +623,8 @@ hash_add:
        return 0;
 
 clear_multi:
-       dev_set_allmulti(lowerdev, -1);
+       if (dev->flags & IFF_ALLMULTI)
+               dev_set_allmulti(lowerdev, -1);
 del_unicast:
        dev_uc_del(lowerdev, dev->dev_addr);
 out: