[ovs-dev] [PATCH V2 1/2] compat: Fix gre header bug

William Tu u9012063 at gmail.com
Fri Jun 29 12:07:39 UTC 2018


On Thu, Jun 28, 2018 at 8:31 PM, Greg Rose <gvrose8192 at 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 at gmail.com>
> ---

LGTM
Acked-by: William Tu <u9012063 at 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 at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list