diff options
-rw-r--r-- | net/ipv4/ip_tunnel_core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index f4c987bb7e94..88c386cf7d85 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
@@ -91,11 +91,12 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto) | |||
91 | skb_pull_rcsum(skb, hdr_len); | 91 | skb_pull_rcsum(skb, hdr_len); |
92 | 92 | ||
93 | if (inner_proto == htons(ETH_P_TEB)) { | 93 | if (inner_proto == htons(ETH_P_TEB)) { |
94 | struct ethhdr *eh = (struct ethhdr *)skb->data; | 94 | struct ethhdr *eh; |
95 | 95 | ||
96 | if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) | 96 | if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) |
97 | return -ENOMEM; | 97 | return -ENOMEM; |
98 | 98 | ||
99 | eh = (struct ethhdr *)skb->data; | ||
99 | if (likely(ntohs(eh->h_proto) >= ETH_P_802_3_MIN)) | 100 | if (likely(ntohs(eh->h_proto) >= ETH_P_802_3_MIN)) |
100 | skb->protocol = eh->h_proto; | 101 | skb->protocol = eh->h_proto; |
101 | else | 102 | else |