Skip to contentSkip to conversation

Fix the VLAN_TAG_PRESENT in netvsc_recv_callback()

PATCH Applied Haiyang Zhang 2 participants 2 messages Jun 17, 2013

Subsystems (3)
lore
Share & tools
lore

Haiyang Zhang

author maintainer
#0 lore raw

PATCH 1/1 Fix the VLAN_TAG_PRESENT in netvsc_recv_callback()

We should call __vlan_hwaccel_put_tag() only if the packet comes from vlan, otherwise VLAN_TAG_PRESENT will always be added.

---
 drivers/net/hyperv/netvsc_drv.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/hyperv/netvsc_drv.c +3 -1
index ab2307b..4dccead 100644
@@ -285,7 +285,9 @@ int netvsc_recv_callback(struct hv_device *device_obj,
 
 	skb->protocol = eth_type_trans(skb, net);
 	skb->ip_summed = CHECKSUM_NONE;
-	__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet->vlan_tci);
+	if (packet->vlan_tci & VLAN_TAG_PRESENT)
+		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
+				       packet->vlan_tci);
 
 	net->stats.rx_packets++;
 	net->stats.rx_bytes += packet->total_data_buflen;
Signature · 1 line
1.7.4.1