mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 00:38:55 +00:00
ip_gre: fix wrong return value of erspan_rcv
If pskb_may_pull return failed, return PACKET_REJECT instead of -ENOMEM. Fixes: 84e54fe0a5ea ("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:
parent
c647c0d62c
commit
c05fad5713
@ -266,7 +266,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
|
||||
len = gre_hdr_len + sizeof(*ershdr);
|
||||
|
||||
if (unlikely(!pskb_may_pull(skb, len)))
|
||||
return -ENOMEM;
|
||||
return PACKET_REJECT;
|
||||
|
||||
iph = ip_hdr(skb);
|
||||
ershdr = (struct erspanhdr *)(skb->data + gre_hdr_len);
|
||||
|
Loading…
x
Reference in New Issue
Block a user