diff options
author | Haishuang Yan <yanhaishuang@cmss.chinamobile.com> | 2017-12-15 10:46:16 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-15 14:10:39 -0500 |
commit | c05fad5713b81b049ec6ac4eb2d304030b1efdce (patch) | |
tree | cef6c8af0d596b155329b1508fe754c13894f65a | |
parent | c647c0d62c82eb3ddf78a0d8b3d58819d9f552aa (diff) |
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>
-rw-r--r-- | net/ipv4/ip_gre.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index bb6239169b1a..9c1735632c8c 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -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); |