From: William Tu <[email protected]>

Upstream commit:
    commit d6aa71197ffcb68850bfebfc3fc160abe41df53b
    Author: William Tu <[email protected]>
    Date:   Fri Mar 9 07:34:41 2018 -0800

    ip6erspan: improve error handling for erspan version number.

    When users fill in incorrect erspan version number through
    the struct erspan_metadata uapi, current code skips pushing
    the erspan header but continue pushing the gre header, which
    is incorrect.  The patch fixes it by returning error.

    Signed-off-by: William Tu <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Cc: William Tu <[email protected]>
Signed-off-by: Greg Rose <[email protected]>
---
 datapath/linux/compat/ip6_gre.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index 2f5fe49..25f24e3 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -1136,6 +1136,8 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff 
*skb,
                                truncate, false);
                tpi.hdr_len = ERSPAN_V2_MDSIZE;
                tpi.proto = htons(ETH_P_ERSPAN2);
+       } else {
+               goto tx_err;
        }
 
        tpi.flags = TUNNEL_SEQ;
-- 
1.8.3.1

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

Reply via email to