* [PATCHv3 iproute2] erspan: set erspan_ver to 1 by default
@ 2020-02-18 3:50 Xin Long
2020-02-18 17:16 ` William Tu
0 siblings, 1 reply; 2+ messages in thread
From: Xin Long @ 2020-02-18 3:50 UTC (permalink / raw
To: network dev, stephen; +Cc: William Tu, David Ahern
Commit 289763626721 ("erspan: add erspan version II support")
breaks the command:
# ip link add erspan1 type erspan key 1 seq erspan 123 \
local 10.1.0.2 remote 10.1.0.1
as erspan_ver is set to 0 by default, then IFLA_GRE_ERSPAN_INDEX
won't be set in gre_parse_opt().
# ip -d link show erspan1
...
erspan remote 10.1.0.1 local 10.1.0.2 ... erspan_index 0 erspan_ver 1
^^^^^^^^^^^^^^
This patch is to change to set erspan_ver to 1 by default.
v1->v2:
- no change.
v2->v3:
- add the same fix for v6.
Fixes: 289763626721 ("erspan: add erspan version II support")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
ip/link_gre.c | 2 +-
ip/link_gre6.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/link_gre.c b/ip/link_gre.c
index 15beb73..e42f21a 100644
--- a/ip/link_gre.c
+++ b/ip/link_gre.c
@@ -94,7 +94,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 metadata = 0;
__u32 fwmark = 0;
__u32 erspan_idx = 0;
- __u8 erspan_ver = 0;
+ __u8 erspan_ver = 1;
__u8 erspan_dir = 0;
__u16 erspan_hwid = 0;
diff --git a/ip/link_gre6.c b/ip/link_gre6.c
index 9d1741b..94a4ee7 100644
--- a/ip/link_gre6.c
+++ b/ip/link_gre6.c
@@ -106,7 +106,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
__u8 metadata = 0;
__u32 fwmark = 0;
__u32 erspan_idx = 0;
- __u8 erspan_ver = 0;
+ __u8 erspan_ver = 1;
__u8 erspan_dir = 0;
__u16 erspan_hwid = 0;
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCHv3 iproute2] erspan: set erspan_ver to 1 by default
2020-02-18 3:50 [PATCHv3 iproute2] erspan: set erspan_ver to 1 by default Xin Long
@ 2020-02-18 17:16 ` William Tu
0 siblings, 0 replies; 2+ messages in thread
From: William Tu @ 2020-02-18 17:16 UTC (permalink / raw
To: Xin Long; +Cc: network dev, Stephen Hemminger, David Ahern
On Mon, Feb 17, 2020 at 7:50 PM Xin Long <lucien.xin@gmail.com> wrote:
>
> Commit 289763626721 ("erspan: add erspan version II support")
> breaks the command:
>
> # ip link add erspan1 type erspan key 1 seq erspan 123 \
> local 10.1.0.2 remote 10.1.0.1
>
> as erspan_ver is set to 0 by default, then IFLA_GRE_ERSPAN_INDEX
> won't be set in gre_parse_opt().
>
> # ip -d link show erspan1
> ...
> erspan remote 10.1.0.1 local 10.1.0.2 ... erspan_index 0 erspan_ver 1
> ^^^^^^^^^^^^^^
>
> This patch is to change to set erspan_ver to 1 by default.
>
> v1->v2:
> - no change.
> v2->v3:
> - add the same fix for v6.
>
> Fixes: 289763626721 ("erspan: add erspan version II support")
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
LGTM. Thanks!
Acked-by: William Tu <u9012063@gmail.com>
> ---
> ip/link_gre.c | 2 +-
> ip/link_gre6.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ip/link_gre.c b/ip/link_gre.c
> index 15beb73..e42f21a 100644
> --- a/ip/link_gre.c
> +++ b/ip/link_gre.c
> @@ -94,7 +94,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
> __u8 metadata = 0;
> __u32 fwmark = 0;
> __u32 erspan_idx = 0;
> - __u8 erspan_ver = 0;
> + __u8 erspan_ver = 1;
> __u8 erspan_dir = 0;
> __u16 erspan_hwid = 0;
>
> diff --git a/ip/link_gre6.c b/ip/link_gre6.c
> index 9d1741b..94a4ee7 100644
> --- a/ip/link_gre6.c
> +++ b/ip/link_gre6.c
> @@ -106,7 +106,7 @@ static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
> __u8 metadata = 0;
> __u32 fwmark = 0;
> __u32 erspan_idx = 0;
> - __u8 erspan_ver = 0;
> + __u8 erspan_ver = 1;
> __u8 erspan_dir = 0;
> __u16 erspan_hwid = 0;
>
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-18 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 3:50 [PATCHv3 iproute2] erspan: set erspan_ver to 1 by default Xin Long
2020-02-18 17:16 ` William Tu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.