Hi, On Wed, May 23, 2018 at 10:34:19PM -0400, David Higgs wrote: > I am using route(8) in a script but found some odd behavior when > querying routes for some IPv6 addresses - lookups seem to fail if the > trailing address bytes are zero (implicit or explicitly) as shown > below. However, the routing table still seems to be forwarding > traffic correctly, as shown in my final example. > > Can anyone shed light on this, perhaps explain how I'm misusing route(8)? >
route is getting confused between host address and network address. Try with route -n get 2607:f8b0:4004:805::/128 > This is on amd64 running 6.3-stable. > > Thanks. > > --david > > > $ route -n get 2607:f8b0:4004:805::2004 > route to: 2607:f8b0:4004:805::2004 > destination: :: > mask: :: > gateway: fe80:1::201:5cff:fe86:7046%em0 > interface: em0 > if address: fe80::5e8c:75d:e349:26fd%em0 > priority: 56 (default) > flags: <UP,GATEWAY,DONE,STATIC> > label: slaacd > use mtu expire > 220369 0 0 > sockaddrs: <DST,GATEWAY,NETMASK,IFP,IFA,LABEL> > > $ route -n get 2607:f8b0:4004:805:: > get net 2607:f8b0:4004:805::: not in table > > $ route -n get 2600:1901:0:94b6:: > get net 2600:1901:0:94b6::: not in table > > $ ping6 2600:1901:0:94b6:: > PING 2600:1901:0:94b6:: (2600:1901:0:94b6::): 56 data bytes > 64 bytes from 2600:1901:0:94b6::: icmp_seq=0 hlim=54 time=10.302 ms > 64 bytes from 2600:1901:0:94b6::: icmp_seq=1 hlim=54 time=11.270 ms >