diff options
author | Haiyang Zhang <haiyangz@microsoft.com> | 2013-06-17 18:36:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-17 18:58:11 -0400 |
commit | 93725cbd22ed716bea8dc479b4925d40a4dbd0c6 (patch) | |
tree | c598fcb86140fded02aa0554bbb1fb0e5b5d6229 | |
parent | 7aa27238417a34ec9be2d8eff05ceff319f2d39b (diff) |
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: 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>
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index ab2307b5d9a7..4dccead586be 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -285,7 +285,9 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
285 | 285 | ||
286 | skb->protocol = eth_type_trans(skb, net); | 286 | skb->protocol = eth_type_trans(skb, net); |
287 | skb->ip_summed = CHECKSUM_NONE; | 287 | skb->ip_summed = CHECKSUM_NONE; |
288 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet->vlan_tci); | 288 | if (packet->vlan_tci & VLAN_TAG_PRESENT) |
289 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), | ||
290 | packet->vlan_tci); | ||
289 | 291 | ||
290 | net->stats.rx_packets++; | 292 | net->stats.rx_packets++; |
291 | net->stats.rx_bytes += packet->total_data_buflen; | 293 | net->stats.rx_bytes += packet->total_data_buflen; |