Message ID | 1530226860-26032-1-git-send-email-gvrose8192@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [ovs-dev,1/2] compat: Fix gre header bug | expand |
On Thu, Jun 28, 2018 at 4:00 PM, Greg Rose <gvrose8192@gmail.com> wrote: > Commit 436d36db introduced a bug into the gre header build for gre and > ip gre type tunnels. __vlan_hwaccel_push_inside does not check whether > the vlan tag is even present. So check first and avoid padding space > for a vlan tag that isn't present. > > Fixes: 436d36db ("compat: Fixups for newer kernels") > Signed-off-by: Greg Rose <gvrose8192@gmail.com> > --- Looks good to me. Acked-by: William Tu <u9012063@gmail.com> > datapath/linux/compat/ip_gre.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c > index ac9fb8b..df0217e 100644 > --- a/datapath/linux/compat/ip_gre.c > +++ b/datapath/linux/compat/ip_gre.c > @@ -552,10 +552,12 @@ netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb) > goto err_free_rt; > } > > - skb = __vlan_hwaccel_push_inside(skb); > - if (unlikely(!skb)) { > - err = -ENOMEM; > - goto err_free_rt; > + if (skb_vlan_tag_present(skb)) { > + skb = __vlan_hwaccel_push_inside(skb); > + if (unlikely(!skb)) { > + err = -ENOMEM; > + goto err_free_rt; > + } > } > > /* Push Tunnel header. */ > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c index ac9fb8b..df0217e 100644 --- a/datapath/linux/compat/ip_gre.c +++ b/datapath/linux/compat/ip_gre.c @@ -552,10 +552,12 @@ netdev_tx_t rpl_gre_fb_xmit(struct sk_buff *skb) goto err_free_rt; } - skb = __vlan_hwaccel_push_inside(skb); - if (unlikely(!skb)) { - err = -ENOMEM; - goto err_free_rt; + if (skb_vlan_tag_present(skb)) { + skb = __vlan_hwaccel_push_inside(skb); + if (unlikely(!skb)) { + err = -ENOMEM; + goto err_free_rt; + } } /* Push Tunnel header. */
Commit 436d36db introduced a bug into the gre header build for gre and ip gre type tunnels. __vlan_hwaccel_push_inside does not check whether the vlan tag is even present. So check first and avoid padding space for a vlan tag that isn't present. Fixes: 436d36db ("compat: Fixups for newer kernels") Signed-off-by: Greg Rose <gvrose8192@gmail.com> --- datapath/linux/compat/ip_gre.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)