Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[VLAN]: Fix early vlan adding leads to not functional device

OK, I can see what's happening here. eth0 doesn't detect link-up until
after a few seconds, so when the vlan interface is opened immediately
after eth0 has been opened, it inherits the link-down state. Subsequently
the vlan interface is never properly activated and are thus unable to
transmit any packets.

dev->state bits are not supposed to be manipulated directly. Something
similar is probably needed for the netif_device_present() bit, although
I don't know how this is meant to work for a virtual device.

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tommy Christensen and committed by
David S. Miller
f4637b55 ab611487

+8
+8
net/8021q/vlan.c
··· 578 578 if (!vlandev) 579 579 continue; 580 580 581 + if (netif_carrier_ok(dev)) { 582 + if (!netif_carrier_ok(vlandev)) 583 + netif_carrier_on(vlandev); 584 + } else { 585 + if (netif_carrier_ok(vlandev)) 586 + netif_carrier_off(vlandev); 587 + } 588 + 581 589 if ((vlandev->state & VLAN_LINK_STATE_MASK) != flgs) { 582 590 vlandev->state = (vlandev->state &~ VLAN_LINK_STATE_MASK) 583 591 | flgs;