Skip to contentSkip to conversation

: Don't copy ALLMULTI/PROMISC flags from underlying device

VLAN Patrick McHardy 2 participants 2 messages Mar 26, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

commit 23309e2679f45ffd6406a269310742a05eabfd99

Author: Patrick McHardy <[email protected]>
Date:   Wed Mar 26 06:29:07 2008 +0100

[VLAN]: Don't copy ALLMULTI/PROMISC flags from underlying device

Changing these flags requires to use dev_set_allmulti/dev_set_promiscuity or dev_change_flags. Setting it directly causes two unwanted effects:

- the next dev_change_flags call will notice a difference between dev->gflags and the actual flags, enable promisc/allmulti mode and incorrectly update dev->gflags

- this keeps the underlying device in promisc/allmulti mode until the VLAN device is deleted

net/8021q/vlan_dev.c +1 -1
index 1e5c990..cd573b3 100644
@@ -660,7 +660,7 @@ static int vlan_dev_init(struct net_device *dev)
 	int subclass = 0;
 
 	/* IFF_BROADCAST|IFF_MULTICAST; ??? */
-	dev->flags  = real_dev->flags & ~IFF_UP;
+	dev->flags  = real_dev->flags & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI);
 	dev->iflink = real_dev->ifindex;
 	dev->state  = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
 					  (1<<__LINK_STATE_DORMANT))) |
maintainer
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Wed, 26 Mar 2008 06:44:40 +0100

Quoted 9 lines

commit 23309e2679f45ffd6406a269310742a05eabfd99

Author: Patrick McHardy <[email protected]>
Date:   Wed Mar 26 06:29:07 2008 +0100

[VLAN]: Don't copy ALLMULTI/PROMISC flags from underlying device

Changing these flags requires to use dev_set_allmulti/dev_set_promiscuity or dev_change_flags. Setting it directly causes two unwanted effects:

Quoted 8 lines

- the next dev_change_flags call will notice a difference between dev->gflags and the actual flags, enable promisc/allmulti mode and incorrectly update dev->gflags

- this keeps the underlying device in promisc/allmulti mode until the VLAN device is deleted

Applied and I'll queue this up for -stable too.