Skip to content

Commit

Permalink
Fix the VLAN_TAG_PRESENT in netvsc_recv_callback()
Browse files Browse the repository at this point in the history
We should call __vlan_hwaccel_put_tag() only if the packet
comes from vlan, otherwise VLAN_TAG_PRESENT will always be
added.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Haiyang Zhang authored and David S. Miller committed Jun 17, 2013
1 parent 7aa2723 commit 93725cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 93725cb

Please sign in to comment.