Skip to content

Commit c05fad5

Browse files
Haishuang Yandavem330
authored andcommitted
ip_gre: fix wrong return value of erspan_rcv
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]>
1 parent c647c0d commit c05fad5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/ip_gre.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
266266
len = gre_hdr_len + sizeof(*ershdr);
267267

268268
if (unlikely(!pskb_may_pull(skb, len)))
269-
return -ENOMEM;
269+
return PACKET_REJECT;
270270

271271
iph = ip_hdr(skb);
272272
ershdr = (struct erspanhdr *)(skb->data + gre_hdr_len);

0 commit comments

Comments
 (0)