Package: iproute2 Version: 4.20.0-2 Severity: normal Tags: ipv6 upstream
When using `ip route get` with 0.0.0.0 or ::, iproute2 shows multiple incorrect behaviors: - `ip route get 0.0.0.0/0` answers "need at least a destination address", where it should answer with the default route. 0.0.0.0/0 is a valid network and it should be possible to query for the default route that way - similarly, `ip route get `::/0` also answers "need at least a destination address". For the same reason, it should also answer with the default route. - finally, `ip route get 0.0.0.0/1`, or any other non-0 netmask, answers with "local 0.0.0.0 dev lo src 127.0.0.1 uid 1000", which is simply wrong. 0.0.0.0/1 IS NOT routed via lo, and this query should answer with the most-specific route for 0.0.0.0/1 or the default if there is no such route. Interestingly, `ip route get 1.0.0.0/1`, while a query for the exact same subnet, actually gives the right route (in my case, the default route). The first two problems seem to be caused by this line in iproute2 error handling https://github.com/shemminger/iproute2/blob/master/ip/iproute.c#L1425, which is written without taking into consideration that netmasks of length 0 are actually valid; I have no idea where the last problem originates unfortunately. Thank you -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (900, 'testing'), (800, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 4.19.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages iproute2 depends on: ii debconf [debconf-2.0] 1.5.70 ii libc6 2.28-5 ii libcap2 1:2.25-1.2 ii libcap2-bin 1:2.25-1.2 ii libdb5.3 5.3.28+dfsg1-0.2 ii libelf1 0.175-2 ii libmnl0 1.0.4-2 ii libselinux1 2.8-1+b1 ii libxtables12 1.8.2-3 Versions of packages iproute2 recommends: pn libatm1 <none> Versions of packages iproute2 suggests: pn iproute2-doc <none> -- debconf information: iproute2/setcaps: false