[ovs-dev] [PATCH 34/41] ip6erspan: improve error handling for erspan version number.

Greg Rose gvrose8192 at gmail.com
Thu May 17 21:15:26 UTC 2018


From: William Tu <u9012063 at gmail.com>

Upstream commit:
    commit d6aa71197ffcb68850bfebfc3fc160abe41df53b
    Author: William Tu <u9012063 at gmail.com>
    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 <u9012063 at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Cc: William Tu <u9012063 at gmail.com>
Signed-off-by: Greg Rose <gvrose8192 at gmail.com>
---
 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



More information about the dev mailing list