Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93725cbd authored by Haiyang Zhang's avatar Haiyang Zhang Committed by David S. Miller
Browse files

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.

Reported-by: default avatarOlaf Hering <olaf@aepfle.de>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7aa27238
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;