Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Oct 2016 09:19:36 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 213354] route reports incorrect results
Message-ID:  <bug-213354-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213354

            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@FreeBSD.org
          Reporter: emz@norma.perm.ru

Consider I have the following interface:

# ifconfig gre1
gre1: flags=3D8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1431
        options=3D80000<LINKSTATE>
        tunnel inet 172.16.4.28 --> 172.16.4.0
        inet 172.16.0.1 --> 172.16.0.0 netmask 0xffffffff=20
        inet6 fe80::21a:64ff:fe21:9489%gre1 prefixlen 64 scopeid 0x15=20
        nd6 options=3D21<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=20=20=20=20=20=20=20=20=20
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=20=20=20
route: writing to routing socket: No such process

And only one method works:

[root@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=3Da051<UP,POINTOPOINT,RUNNING,LINK1,MULTICAST> metric 0 mtu 1431
        options=3D80000<LINKSTATE>
        tunnel inet 172.16.4.27 --> 172.16.4.30
        inet6 fe80::21a:64ff:fe21:9489%gre0 prefixlen 64 scopeid 0x14=20
        inet 172.16.1.81 --> 172.16.1.80 netmask 0xffffffff=20
        nd6 options=3D21<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=20

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 a=
nd
what process is it talking about. It is cryptic, misleading and weird, I re=
ally
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 personal=
ly
think it's some geological artifact that keeps people stubmling on.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-213354-8>