]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ip tunnel: warn when changing IPv6 tunnel without tunnel name
authorAndrea Claudi <aclaudi@redhat.com>
Tue, 9 Jul 2019 13:16:51 +0000 (15:16 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 16 Jul 2019 19:26:21 +0000 (12:26 -0700)
commitd035cc1b4e83e2589ea2115cdc2fa7c6d3693a5a
treece0c90656469dcc323e64f7ed7d4f323b166b7aa
parentad04dbc5b41df509cd6925eab36af73000632fd2
ip tunnel: warn when changing IPv6 tunnel without tunnel name

Tunnel change fails if a tunnel name is not specified while using
'ip -6 tunnel change'. However, no warning message is printed and
no error code is returned.

$ ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none dev dummy0
$ ip -6 tunnel change dev dummy0 local 2001:1234::1 remote 2001:1234::2
$ ip -6 tunnel show ip6tnl1
ip6tnl1: gre/ipv6 remote fd::2 local fd::1 dev dummy0 encaplimit none hoplimit 127 tclass inherit flowlabel 0x00000 (flowinfo 0x00000000)

This commit checks if tunnel interface name is equal to an empty
string: in this case, it prints a warning message to the user.
It intentionally avoids to return an error to not break existing
script setup.

This is the output after this commit:
$ ip -6 tunnel add ip6tnl1 mode ip6gre local fd::1 remote fd::2 tos inherit ttl 127 encaplimit none dev dummy0
$ ip -6 tunnel change dev dummy0 local 2001:1234::1 remote 2001:1234::2
Tunnel interface name not specified
$ ip -6 tunnel show ip6tnl1
ip6tnl1: gre/ipv6 remote fd::2 local fd::1 dev dummy0 encaplimit none hoplimit 127 tclass inherit flowlabel 0x00000 (flowinfo 0x00000000)

Reviewed-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ip6tunnel.c