summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahesh Bandewar <maheshb@google.com>2019-06-06 16:44:26 -0700
committerStephen Hemminger <stephen@networkplumber.org>2019-06-10 10:43:09 -0700
commitba126dcad20e6d0e472586541d78bdd1ac4f1123 (patch)
tree6bcb4d6c1aa89d82ac2013065f74aa0f56f589ad
parent80a931d41c0587a4f5bfc1ece7eddac3442b5d9a (diff)
downloadiproute2-ba126dcad20e6d0e472586541d78bdd1ac4f1123.tar.gz
ip6tunnel: fix 'ip -6 {show|change} dev <name>' cmds
Inclusion of 'dev' is allowed by the syntax but not handled correctly by the command. It produces no output for show command and falsely successful for change command but does not make any changes. can be verified with the following steps # ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none # ip -6 tunnel show ip6tnl1 <correct output> # ip -6 tunnel show dev ip6tnl1 <no output but correct output after this change> # ip -6 tunnel change dev ip6tnl1 local 2001:1234::1 remote 2001:1234::2 encaplimit none ttl 127 tos inherit allow-localremote # echo $? 0 # ip -6 tunnel show ip6tnl1 <no changes applied, but changes are correctly applied after this change> Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
-rw-r--r--ip/ip6tunnel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
index 999408ed..56fd3466 100644
--- a/ip/ip6tunnel.c
+++ b/ip/ip6tunnel.c
@@ -298,6 +298,8 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm2 *p)
p->link = ll_name_to_index(medium);
if (!p->link)
return nodev(medium);
+ else
+ strlcpy(p->name, medium, sizeof(p->name));
}
return 0;
}