]> git.ipfire.org Git - thirdparty/iproute2.git/commit
Fix changing tunnel remote and local address to any
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Thu, 4 Jun 2015 12:01:18 +0000 (09:01 -0300)
committerStephen Hemminger <shemming@brocade.com>
Thu, 25 Jun 2015 12:45:24 +0000 (08:45 -0400)
commit4e4b78324f1dbcee590c01a7ac3e5ebaf20daa27
tree9a8c35c59a5aed4cf5cbb4d05d3f35e96b308167
parent30383b074de101c778bc65c36e2b0d4690d3d6dc
Fix changing tunnel remote and local address to any

If a tunnel is created with a local address, you can't change it to any.

 # ip tunnel add tunl1 mode ipip remote 10.16.42.37 local 10.16.42.214 ttl 64
 # ip tunnel show tunl1
 tunl1: ip/ip  remote 10.16.42.37  local 10.16.42.214  ttl 64
 # ip tunnel change tunl1 local any
 # echo $?
 0
 # ip tunnel show tunl1
 tunl1: ip/ip  remote 10.16.42.37  local 10.16.42.214  ttl 64

It happens that parse_args zeroes ip_tunnel_parm, and when creating the
tunnel, it is OK to leave it as is if the address is any. However, when
changing the tunnel, the current parameters will be read from
ip_tunnel_parm, and local and remote address won't be zeroes anymore, so
it needs to be explicitly set to any.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
ip/iptunnel.c