ip_gre: fix wrong return value of erspan_rcv

If pskb_may_pull return failed, return PACKET_REJECT instead of -ENOMEM.

Fixes: 84e54fe0a5 ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <u9012063@gmail.com>
Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>
Acked-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Haishuang Yan 2017-12-15 10:46:16 +08:00 committed by David S. Miller
parent c647c0d62c
commit c05fad5713
1 changed files with 1 additions and 1 deletions

View File

@ -266,7 +266,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
len = gre_hdr_len + sizeof(*ershdr); len = gre_hdr_len + sizeof(*ershdr);
if (unlikely(!pskb_may_pull(skb, len))) if (unlikely(!pskb_may_pull(skb, len)))
return -ENOMEM; return PACKET_REJECT;
iph = ip_hdr(skb); iph = ip_hdr(skb);
ershdr = (struct erspanhdr *)(skb->data + gre_hdr_len); ershdr = (struct erspanhdr *)(skb->data + gre_hdr_len);