netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 1/1] driver: macvlan: Check if need rollback multicast setting in macvlan_open
@ 2016-11-22  1:54 fgao
  2016-11-24  1:26 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: fgao @ 2016-11-22  1:54 UTC (permalink / raw)
  To: davem, kaber, netdev, gfree.wind; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

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

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index d2d6f12..26d6f0b 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -623,7 +623,8 @@ static int macvlan_open(struct net_device *dev)
 	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:
-- 
1.9.1

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

* Re: [PATCH net 1/1] driver: macvlan: Check if need rollback multicast setting in macvlan_open
  2016-11-22  1:54 [PATCH net 1/1] driver: macvlan: Check if need rollback multicast setting in macvlan_open fgao
@ 2016-11-24  1:26 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-11-24  1:26 UTC (permalink / raw)
  To: fgao; +Cc: kaber, netdev, gfree.wind

From: fgao@ikuai8.com
Date: Tue, 22 Nov 2016 09:54:36 +0800

> From: Gao Feng <fgao@ikuai8.com>
> 
> 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>

Applied.

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

end of thread, other threads:[~2016-11-24  1:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-22  1:54 [PATCH net 1/1] driver: macvlan: Check if need rollback multicast setting in macvlan_open fgao
2016-11-24  1:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).