]> git.proxmox.com Git - mirror_iproute2.git/commit
ip/tunnel: Correct and unify ttl/hoplimit printing
authorSerhey Popovych <serhe.popovych@gmail.com>
Thu, 18 Jan 2018 14:04:29 +0000 (16:04 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 19 Jan 2018 00:34:40 +0000 (16:34 -0800)
commit375560c4ab61cae567afbb9a64036a009cfeaecc
tree6eb5c5310a0a43ec4159747d471b55cfc2564cea
parent45d3a6efb20d62cd5c618898a32906dcfd5a08d2
ip/tunnel: Correct and unify ttl/hoplimit printing

Both ttl/hoplimit is from 1 to 255. Zero has special meaning:
use encapsulated packet value. In ip-link(8) -d output this
looks like "ttl/hoplimit inherit". In JSON we have "int" type
for ttl and therefore values from 0 (inherit) to 255.

To do the best in handling ttl/hoplimit we need to accept
both cases: missing attribute in netlink dump and zero value
for "inherit"ed case. Last one is broken since JSON output
introduction for gre/iptnl versions and was never true for
gre6/ip6tnl.

For all tunnels, except ip6tnl change JSON type from "int" to
"uint" to reflect true nature of the ttl.

Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ip6tunnel.c
ip/iplink_geneve.c
ip/iplink_vxlan.c
ip/iproute_lwtunnel.c
ip/iptunnel.c
ip/link_gre.c
ip/link_gre6.c
ip/link_ip6tnl.c
ip/link_iptnl.c