]> git.proxmox.com Git - mirror_iproute2.git/commit
ip route: get: allow zero-length subnet mask
authorLuca Boccassi <bluca@debian.org>
Thu, 14 Feb 2019 23:29:18 +0000 (23:29 +0000)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 19 Feb 2019 23:19:31 +0000 (15:19 -0800)
commitc2f9dc14c41f388764f7634d36c3d05e354f053a
tree1ab8e668b0c65a0d6d64fcfdbef1a61f0b71af7a
parent619765fe14b640c9aa8eff73fa5bc32da3cbfe80
ip route: get: allow zero-length subnet mask

A /0 subnet mask is theoretically valid, but ip route get doesn't allow
it:

$ ip route get 1.0.0.0/0
need at least a destination address

Change the check and remember whether we found an address or not, since
according to the documentation it's a mandatory parameter.

$ ip/ip route get 1.0.0.0/0
1.0.0.0 via 192.168.1.1 dev eth0 src 192.168.1.91 uid 1000
    cache

Reported-by: Clément Hertling <wxcafe@wxcafe.net>
Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/iproute.c