[ovs-dev] erspan: set erspan_ver to 1 by default when adding an erspan dev

Message ID 1536269914-6739-1-git-send-email-gvrose8192@gmail.com
State New
Headers show
Series
  • [ovs-dev] erspan: set erspan_ver to 1 by default when adding an erspan dev
Related show

Commit Message

Gregory Rose Sept. 6, 2018, 9:38 p.m.
From: Xin Long <lucien.xin@gmail.com>

Upstream commit:
    commit 84581bdae9587023cea1d139523f0ef0f28bd88d
    Author: Xin Long <lucien.xin@gmail.com>
    Date:   Mon Aug 27 18:41:32 2018 +0800

    erspan: set erspan_ver to 1 by default when adding an erspan dev

    After erspan_ver is introudced, if erspan_ver is not set in iproute, its
    value will be left 0 by default. Since Commit 02f99df1875c ("erspan: fix
    invalid erspan version."), it has broken the traffic due to the version
    check in erspan_xmit if users are not aware of 'erspan_ver' param, like
    using an old version of iproute.

    To fix this compatibility problem, it sets erspan_ver to 1 by default
    when adding an erspan dev in erspan_setup. Note that we can't do it in
    ipgre_netlink_parms, as this function is also used by ipgre_changelink.

    Fixes: 02f99df1875c ("erspan: fix invalid erspan version.")
    Reported-by: Jianlin Shi <jishi@redhat.com>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Fixes: 5e720da59d ("erspan: fix invalid erspan version.")
Cc: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip6_gre.c | 1 +
 datapath/linux/compat/ip_gre.c  | 3 +++
 2 files changed, 4 insertions(+)

Comments

0-day Robot Sept. 6, 2018, 9:57 p.m. | #1
Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Xin Long <lucien.xin@gmail.com> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
Lines checked: 71, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@bytheb.org

Thanks,
0-day Robot
Gregory Rose Sept. 6, 2018, 10:11 p.m. | #2
On 9/6/2018 2:57 PM, 0-day Robot wrote:
> Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
> Thanks for your contribution.
>
> I encountered some error that I wasn't expecting.  See the details below.
>
>
> checkpatch:
> ERROR: Author Xin Long <lucien.xin@gmail.com> needs to sign off.
> WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
> Lines checked: 71, Warnings: 1, Errors: 1
>
>
> Please check this out.  If you feel there has been an error, please email aconole@bytheb.org
>
> Thanks,
> 0-day Robot

This seems like a false positive to me.

Thanks,

- Greg
Ben Pfaff Sept. 6, 2018, 11:01 p.m. | #3
On Thu, Sep 06, 2018 at 03:11:37PM -0700, Gregory Rose wrote:
> On 9/6/2018 2:57 PM, 0-day Robot wrote:
> >Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
> >Thanks for your contribution.
> >
> >I encountered some error that I wasn't expecting.  See the details below.
> >
> >
> >checkpatch:
> >ERROR: Author Xin Long <lucien.xin@gmail.com> needs to sign off.
> >WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
> >Lines checked: 71, Warnings: 1, Errors: 1
> >
> >
> >Please check this out.  If you feel there has been an error, please email aconole@bytheb.org
> >
> >Thanks,
> >0-day Robot
> 
> This seems like a false positive to me.

Agreed.  Backports are kind of weird commits.

I applied this to master and branch-2.10.
Gregory Rose Sept. 7, 2018, 2:06 a.m. | #4
On 9/6/2018 4:01 PM, Ben Pfaff wrote:
> On Thu, Sep 06, 2018 at 03:11:37PM -0700, Gregory Rose wrote:
>> On 9/6/2018 2:57 PM, 0-day Robot wrote:
>>> Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
>>> Thanks for your contribution.
>>>
>>> I encountered some error that I wasn't expecting.  See the details below.
>>>
>>>
>>> checkpatch:
>>> ERROR: Author Xin Long <lucien.xin@gmail.com> needs to sign off.
>>> WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
>>> Lines checked: 71, Warnings: 1, Errors: 1
>>>
>>>
>>> Please check this out.  If you feel there has been an error, please email aconole@bytheb.org
>>>
>>> Thanks,
>>> 0-day Robot
>> This seems like a false positive to me.
> Agreed.  Backports are kind of weird commits.
>
> I applied this to master and branch-2.10.

Thanks Ben!

Patch

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index 3904455..00dbefc 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -1979,6 +1979,7 @@  static void ip6gre_netlink_parms(struct nlattr *data[],
 	if (data[IFLA_GRE_COLLECT_METADATA])
 		parms->collect_md = true;
 
+	parms->erspan_ver = 1;
 	if (data[IFLA_GRE_ERSPAN_VER])
 		parms->erspan_ver = nla_get_u8(data[IFLA_GRE_ERSPAN_VER]);
 
diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 47ed5e0..05132ba 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -1222,12 +1222,15 @@  static void ipgre_tap_setup(struct net_device *dev)
 
 static void erspan_setup(struct net_device *dev)
 {
+	struct ip_tunnel *t = netdev_priv(dev);
+
 	eth_hw_addr_random(dev);
 	ether_setup(dev);
 	dev->netdev_ops = &erspan_netdev_ops;
 	dev->priv_flags &= ~IFF_TX_SKB_SHARING;
 	dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
 	ip_tunnel_setup(dev, erspan_net_id);
+	t->erspan_ver = 1;
 }
 
 #ifdef HAVE_EXT_ACK_IN_RTNL_LINKOPS