Fix return status for ip route -6 get default
If there is no default for a ipv6 default route, Ubuntu just returns an empty result.
So this change just mimics linux's ip behavior.
Before
$ ./src/ip.py -6 -json route get default
route: writing to routing socket: not in table
After
$ ./src/ip.py -6 route get default
$ ./src/ip.py -6 -json route get default
[]
Thanks you for the PR and sorry for the delay. Can you please provide output from the ubuntu? This is what I am seeing on one of my Debian machines:
user@debian:~$ ip -V
ip utility, iproute2-6.1.0, libbpf 1.1.0
user@debian:~$ ip -6 r
fe80::/64 dev enp1s0 proto kernel metric 256 pref medium
user@debian:~$ ip -6 route get default
Warning: /0 as prefix is invalid, only /128 (or none) is supported.
RTNETLINK answers: Network is unreachable
user@debian:~$ echo $?
2
I want to make sure we return identical error code as well in this case.
Did you have chance to look into this again?
Closing for no reply over 3+ months to my previous question, feel free to re-open. And if this is fixing a bug, please file a bug report first.
thank you. Sorry I zoned out on you