Message ID | 1526690988-29912-35-git-send-email-gvrose8192@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | Add ERSPAN support | expand |
On Fri, May 18, 2018 at 5:49 PM, Greg Rose <gvrose8192@gmail.com> wrote: > From: William Tu <u9012063@gmail.com> > > Upstream commit: > commit d6aa71197ffcb68850bfebfc3fc160abe41df53b > Author: William Tu <u9012063@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@gmail.com> > Signed-off-by: David S. Miller <davem@davemloft.net> > > Cc: William Tu <u9012063@gmail.com> > Signed-off-by: Greg Rose <gvrose8192@gmail.com> > --- LGTM Acked-by: William Tu <u9012063@gmail.com>
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;