Skip to content

Commit

Permalink
hyperv: Fix vlan_proto setting in netvsc_recv_callback()
Browse files Browse the repository at this point in the history
Since the recent addition of 8021AD, we need to set the new field vlan_proto in
sk_buff. Otherwise, it will trigger BUG() call in vlan_proto_idx().

This patch fixes the problem.

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 1, 2013
1 parent 3f3e7ce commit c802db1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <linux/inetdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <net/arp.h>
Expand Down Expand Up @@ -284,7 +285,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,

skb->protocol = eth_type_trans(skb, net);
skb->ip_summed = CHECKSUM_NONE;
skb->vlan_tci = packet->vlan_tci;
__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 c802db1

Please sign in to comment.