From: Haishuang Yan <[email protected]>

Upstream commit:
    commit c05fad5713b81b049ec6ac4eb2d304030b1efdce
    Author: Haishuang Yan <[email protected]>
    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 <[email protected]>
    Signed-off-by: Haishuang Yan <[email protected]>
    Acked-by: William Tu <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Cc:  Haishuang Yan <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
---
 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 eeea4bb..183b451 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -169,7 +169,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

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to