netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next] vlan: turn on unicast filtering on vlan device
@ 2016-02-18 10:00 Zhang Shengju
  2016-02-22  2:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Shengju @ 2016-02-18 10:00 UTC (permalink / raw)
  To: kaber, netdev

Currently vlan device inherits unicast filtering flag from underlying
device. If underlying device doesn't support unicast filter, this will
put vlan device into promiscuous mode when it's stacked.

Tun on IFF_UNICAST_FLT on the vlan device in any case so that it does
not go into promiscuous mode needlessly. If underlying device does not
support unicast filtering, that device will enter promiscuous mode.

Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
---
 net/8021q/vlan.c     | 1 -
 net/8021q/vlan_dev.c | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index d2cd9de..69929c0 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -261,7 +261,6 @@ static int register_vlan_device(struct net_device *real_dev, u16 vlan_id)
 	 * hope the underlying device can handle it.
 	 */
 	new_dev->mtu = real_dev->mtu;
-	new_dev->priv_flags |= (real_dev->priv_flags & IFF_UNICAST_FLT);
 
 	vlan = vlan_dev_priv(new_dev);
 	vlan->vlan_proto = htons(ETH_P_8021Q);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index ad5e2fd..055f0e9 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -799,6 +799,7 @@ void vlan_setup(struct net_device *dev)
 	ether_setup(dev);
 
 	dev->priv_flags		|= IFF_802_1Q_VLAN | IFF_NO_QUEUE;
+	dev->priv_flags		|= IFF_UNICAST_FLT;
 	dev->priv_flags		&= ~IFF_TX_SKB_SHARING;
 	netif_keep_dst(dev);
 
-- 
1.8.3.1

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

* Re: [net-next] vlan: turn on unicast filtering on vlan device
  2016-02-18 10:00 [net-next] vlan: turn on unicast filtering on vlan device Zhang Shengju
@ 2016-02-22  2:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-02-22  2:54 UTC (permalink / raw)
  To: zhangshengju; +Cc: kaber, netdev

From: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Date: Thu, 18 Feb 2016 10:00:11 +0000

> Currently vlan device inherits unicast filtering flag from underlying
> device. If underlying device doesn't support unicast filter, this will
> put vlan device into promiscuous mode when it's stacked.
> 
> Tun on IFF_UNICAST_FLT on the vlan device in any case so that it does
> not go into promiscuous mode needlessly. If underlying device does not
> support unicast filtering, that device will enter promiscuous mode.
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>

Applied, thanks.

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

end of thread, other threads:[~2016-02-22  2:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 10:00 [net-next] vlan: turn on unicast filtering on vlan device Zhang Shengju
2016-02-22  2:54 ` 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).