Skip to content

Commit

Permalink
ip_gre: fix wrong return value of erspan_rcv
Browse files Browse the repository at this point in the history
If pskb_may_pull return failed, return PACKET_REJECT instead of -ENOMEM.

Fixes: 84e54fe ("gre: introduce native tunnel support for ERSPAN")
Cc: William Tu <[email protected]>
Signed-off-by: Haishuang Yan <[email protected]>
Acked-by: William Tu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Haishuang Yan authored and davem330 committed Dec 15, 2017
1 parent c647c0d commit c05fad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c05fad5

Please sign in to comment.