[ovs-dev] [PATCH V2 12/41] ip_gre: fix wrong return value of erspan_rcv

Greg Rose gvrose8192 at gmail.com
Fri May 18 01:57:25 UTC 2018


From: Haishuang Yan <yanhaishuang at cmss.chinamobile.com>

Upstream commit:
    commit c05fad5713b81b049ec6ac4eb2d304030b1efdce
    Author: Haishuang Yan <yanhaishuang at cmss.chinamobile.com>
    Date:   Fri Dec 15 10:46:16 2017 +0800

    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 at gmail.com>
    Signed-off-by: Haishuang Yan <yanhaishuang at cmss.chinamobile.com>
    Acked-by: William Tu <u9012063 at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Cc:  Haishuang Yan <yanhaishuang at cmss.chinamobile.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 datapath/linux/compat/ip_gre.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index dbe86c4..c7912cf 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -223,7 +223,7 @@ static int erspan_rcv(struct sk_buff *skb, struct tnl_ptk_info *tpi,
 	if (tunnel) {
 		len = gre_hdr_len + erspan_hdr_len(ver);
 		if (unlikely(!pskb_may_pull(skb, len)))
-			return -ENOMEM;
+			return PACKET_REJECT;
 
 		if (__iptunnel_pull_header(skb,
 					   len,
-- 
1.8.3.1



More information about the dev mailing list