Skip to content

Commit c802db1

Browse files
haiyangzdavem330
authored andcommitted
hyperv: Fix vlan_proto setting in netvsc_recv_callback()
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 <[email protected]> Reviewed-by: K. Y. Srinivasan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3f3e7ce commit c802db1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/hyperv/netvsc_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <linux/inetdevice.h>
3232
#include <linux/etherdevice.h>
3333
#include <linux/skbuff.h>
34+
#include <linux/if_vlan.h>
3435
#include <linux/in.h>
3536
#include <linux/slab.h>
3637
#include <net/arp.h>
@@ -284,7 +285,7 @@ int netvsc_recv_callback(struct hv_device *device_obj,
284285

285286
skb->protocol = eth_type_trans(skb, net);
286287
skb->ip_summed = CHECKSUM_NONE;
287-
skb->vlan_tci = packet->vlan_tci;
288+
__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet->vlan_tci);
288289

289290
net->stats.rx_packets++;
290291
net->stats.rx_bytes += packet->total_data_buflen;

0 commit comments

Comments
 (0)