aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMatthijs Kooijman <matthijs@stdin.nl>2011-10-31 00:53:13 -0400
committerDavid S. Miller <davem@davemloft.net>2011-11-01 17:51:03 -0400
commitdeede2fabe24e00bd7e246eb81cd5767dc6fcfc7 (patch)
treedac4959510095dfabdcd5b04186e8c9050cf90ec /net
parent045f7b3b0005bf30ad8d664c7651d816e2650cd2 (diff)
vlan: Don't propagate flag changes on down interfaces.
When (de)configuring a vlan interface, the IFF_ALLMULTI ans IFF_PROMISC flags are cleared or set on the underlying interface. So, if these flags are changed on a vlan interface that is not up, the flags underlying interface might be set or cleared twice. Only propagating flag changes when a device is up makes sure this does not happen. It also makes sure that an underlying device is not set to promiscuous or allmulti mode for a vlan device that is down. Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan_dev.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index c8cf9391417e..bc2528624583 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -470,10 +470,12 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
470{ 470{
471 struct net_device *real_dev = vlan_dev_info(dev)->real_dev; 471 struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
472 472
473 if (change & IFF_ALLMULTI) 473 if (dev->flags & IFF_UP) {
474 dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1); 474 if (change & IFF_ALLMULTI)
475 if (change & IFF_PROMISC) 475 dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
476 dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1); 476 if (change & IFF_PROMISC)
477 dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
478 }
477} 479}
478 480
479static void vlan_dev_set_rx_mode(struct net_device *vlan_dev) 481static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)