[Bug 213354] route reports incorrect results
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Mon Oct 10 09:19:37 UTC 2016
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213354
Bug ID: 213354
Summary: route reports incorrect results
Product: Base System
Version: 10.3-STABLE
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: freebsd-bugs at FreeBSD.org
Reporter: emz at norma.perm.ru
Consider I have the following interface:
# ifconfig gre1
gre1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1431
options=80000<LINKSTATE>
tunnel inet 172.16.4.28 --> 172.16.4.0
inet 172.16.0.1 --> 172.16.0.0 netmask 0xffffffff
inet6 fe80::21a:64ff:fe21:9489%gre1 prefixlen 64 scopeid 0x15
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
I have on-interface route for this interface:
# netstat -rn | grep 172.16.0.0
172.16.0.0 link#21 UH gre1
/sbin/route reports the result incorrectly:
# route -n get 172.16.0.0
route: writing to routing socket: No such process
# route -n get 172.16.0.0/32
route: writing to routing socket: No such process
# route -n get -host 172.16.0.0/32
route: writing to routing socket: No such process
# route -n get -net 172.16.0.0/32
route: writing to routing socket: No such process
# route -n get -net 172.16.0.0
route: writing to routing socket: No such process
And only one method works:
[root at crystal-alpha:/etc]# route -n get -host 172.16.0.0
route to: 172.16.0.0
destination: 172.16.0.0
fib: 0
interface: gre1
flags: <UP,HOST,DONE,PINNED>
recvpipe sendpipe ssthresh rtt,msec mtu weight expire
0 0 0 0 1431 1 0
This behaviour differs significantly from other cases with point-to-point
interfaces, with /32 network mask:
# ifconfig gre0
gre0: flags=a051<UP,POINTOPOINT,RUNNING,LINK1,MULTICAST> metric 0 mtu 1431
options=80000<LINKSTATE>
tunnel inet 172.16.4.27 --> 172.16.4.30
inet6 fe80::21a:64ff:fe21:9489%gre0 prefixlen 64 scopeid 0x14
inet 172.16.1.81 --> 172.16.1.80 netmask 0xffffffff
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
# route -n get 172.16.1.80
route to: 172.16.1.80
destination: 172.16.1.80
fib: 0
interface: gre0
flags: <UP,HOST,DONE,PINNED>
recvpipe sendpipe ssthresh rtt,msec mtu weight expire
0 0 0 0 1431 1 0
This issue is probably triggered by the zeroes in te two last octets of the IP
address. I highly doubt someone still uses -net and -host switches, because the
approach "use network part without mask for 'route get'" works like 95% of the
time. I can still be wrong, but I really think this utility should be more
straightforward, and there should not be any exceptions to a general rule.
Furthermore, the message "route: writing to routing socket: No such process" is
kinda "blast from the past", since nobody can recall why is it still here and
what process is it talking about. It is cryptic, misleading and weird, I really
think it should be changed to something more appropriate. To my knowledge,
route is not a process, it's rather an entity in the FIB. Although someone may
find the history behind this message intriguing and interesting, I personally
think it's some geological artifact that keeps people stubmling on.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list