Commit deede2fa authored by Matthijs Kooijman's avatar Matthijs Kooijman Committed by David S. Miller

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: default avatarMatthijs Kooijman <matthijs@stdin.nl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 045f7b3b
...@@ -470,10 +470,12 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change) ...@@ -470,10 +470,12 @@ static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
{ {
struct net_device *real_dev = vlan_dev_info(dev)->real_dev; struct net_device *real_dev = vlan_dev_info(dev)->real_dev;
if (change & IFF_ALLMULTI) if (dev->flags & IFF_UP) {
dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1); if (change & IFF_ALLMULTI)
if (change & IFF_PROMISC) dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1); if (change & IFF_PROMISC)
dev_set_promiscuity(real_dev, dev->flags & IFF_PROMISC ? 1 : -1);
}
} }
static void vlan_dev_set_rx_mode(struct net_device *vlan_dev) static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment