X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=net%2Fcore%2Fdev.c;h=fc1e289397f5895f3d2191ee78c9b450cc33e5cf;hb=09677176610e7c3ed8ddb302fd24bbb59bdbf205;hp=40b1fadaf637cafb12a8aece038882f8ba045274;hpb=a8c4b90e670be3b01e9395c7310639c8109fc77e;p=firefly-linux-kernel-4.4.55.git diff --git a/net/core/dev.c b/net/core/dev.c index 40b1fadaf637..fc1e289397f5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2213,6 +2213,17 @@ __be16 skb_network_protocol(struct sk_buff *skb) __be16 type = skb->protocol; int vlan_depth = ETH_HLEN; + /* Tunnel gso handlers can set protocol to ethernet. */ + if (type == htons(ETH_P_TEB)) { + struct ethhdr *eth; + + if (unlikely(!pskb_may_pull(skb, sizeof(struct ethhdr)))) + return 0; + + eth = (struct ethhdr *)skb_mac_header(skb); + type = eth->h_proto; + } + while (type == htons(ETH_P_8021Q) || type == htons(ETH_P_8021AD)) { struct vlan_hdr *vh;