Skip to content

Commit 6671b22

Browse files
Fernando Luis Vazquez Caodavem330
Fernando Luis Vazquez Cao
authored andcommittedFeb 20, 2014
tun: remove bogus hardware vlan acceleration flags from vlan_features
Even though only the outer vlan tag can be HW accelerated in the transmission path, in the TUN/TAP driver vlan_features mirrors hw_features, which happens to have the NETIF_F_HW_VLAN_?TAG_TX flags set. Because of this, during packet tranmisssion through a stacked vlan device dev_hard_start_xmit, (incorrectly) assuming that the vlan device supports hardware vlan acceleration, does not add the vlan header to the skb payload and the inner vlan tags are lost (vlan_tci contains the outer vlan tag when userspace reads the packet from the tap device). Signed-off-by: Fernando Luis Vazquez Cao <[email protected]> Signed-off-by: Toshiaki Makita <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8d0d21f commit 6671b22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎drivers/net/tun.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,9 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
16861686
TUN_USER_FEATURES | NETIF_F_HW_VLAN_CTAG_TX |
16871687
NETIF_F_HW_VLAN_STAG_TX;
16881688
dev->features = dev->hw_features;
1689-
dev->vlan_features = dev->features;
1689+
dev->vlan_features = dev->features &
1690+
~(NETIF_F_HW_VLAN_CTAG_TX |
1691+
NETIF_F_HW_VLAN_STAG_TX);
16901692

16911693
INIT_LIST_HEAD(&tun->disabled);
16921694
err = tun_attach(tun, file, false);

0 commit comments

Comments
 (0)
Please sign in to comment.