NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/52197: route show [-inet6] truncates and/or misaligns ipv6 numeric addresses



>Number:         52197
>Category:       bin
>Synopsis:       route show [-inet6] truncates and/or misaligns ipv6 numeric addresses
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 27 16:05:00 +0000 2017
>Originator:     Bruce Lilly
>Release:        7.0 STABLE (earliest tested) through 7.1 (latest tested)
>Organization:
>Environment:
$ uname -ors
NetBSD 7.0_STABLE NetBSD

# uname -ors
NetBSD 7.1 NetBSD
>Description:
route show (w/o -n) sometimes outputs unresolved numeric addresses; these are truncated in the output, with misleading semantics, e.g. (numeric addresses obfuscated for privacy):

# route show -inet6 | sed -e 's/[0-9a-f][0-9a-f][0-9a-f][0-9a-f]:/XXXX:/g' -e 's/:[0-9a-f][0-9a-f][0-9a-f][0-9a-f]/:XXXX/g' -e 's/[0-9a-f][0-9a-f]:/XX:/g' -e 's/:[0-9a-f][0-9a-f]/:XX/g'                
Routing tables

Internet6:
Destination        Gateway            Flags    Refs      Use    Mtu Interface
default            XXXX:XXXX:XXXX:0:a UG          -        -      -  bge0
localhost          localhost          UH          -        -  33648  lo0
XXXX:XXXX:XXXX::/6 link#1             U           -        -      -  bge0
XXXX:XXXX:XXXX:0:7 XX:XX:XX:XX:XX:XX  UHL         -        -      -  lo0
XXXX:XXXX:XXXX:0:a XX:XX:XX:XX:XX:XX  UHL         -        -      -  bge0
XXXX::%bge0/64     link#1             U           -        -      -  bge0
XXXX::XXXX:XXXX:XX XX:XX:XX:XX:XX:XX  UHL         -        -      -  lo0
XXXX::XXXX:XXXX:XX XX:XX:XX:XX:XX:XX  UHL         -        -      -  bge0
XXXX::%lo0/64      XXXX::1            U           -        -      -  lo0
XXXX:1::/32        link#1             U           -        -      -  bge0
XXXX:3::/32        localhost          U           -        -      -  lo0
XXXX::%bge0/32     link#1             U           -        -      -  bge0
XXXX::XX           link#1             UHL         -        -      -  bge0
XXXX::%lo0/32      localhost          U           -        -      -  lo0

In the above output, the first numeric destination is shown as a /6 block when it is in fact a /64 block, which is quite a different thing.

With -n, route (via rtutil.c) widens the fields for inet6, but the fields are then misaligned because (1) the spacing of the headings does not match the data field widths and (2) the field widths do not match the data widths. E.g.:

# route -n show -inet6 | sed -e 's/[0-9a-f][0-9a-f][0-9a-f][0-9a-f]:/XXXX:/g' -e 's/:[0-9a-f][0-9a-f][0-9a-f][0-9a-f]/:XXXX/g' -e 's/[0-9a-f][0-9a-f]:/XX:/g' -e 's/:[0-9a-f][0-9a-f]/:XX/g'             
Routing tables

Internet6:
Destination                        Gateway                        Flags    Refs      Use    Mtu Interface
default                            XXXX:XXXX:XXXX:0:XXXX:XXXX:XXXX:XXXX UG          -        -      -  bge0
::1                                ::1                            UH          -        -  33648  lo0
XXXX:XXXX:XXXX::/64                link#1                         U           -        -      -  bge0
XXXX:XXXX:XXXX:0:XXXX:XXXX:XXXX:XXXX XX:XX:XX:XX:XX:XX              UHL         -        -      -  lo0
XXXX:XXXX:XXXX:0:XXXX:XXXX:XXXX:XXXX XX:XX:XX:XX:XX:XX              UHL         -        -      -  bge0
XXXX::%bge0/64                     link#1                         U           -        -      -  bge0
XXXX::XXXX:XXXX:XXXX:XXXX          XX:XX:XX:XX:XX:XX              UHL         -        -      -  lo0
XXXX::XXXX:XXXX:XXXX:XXXX          XX:XX:XX:XX:XX:XX              UHL         -        -      -  bge0
XXXX::%lo0/64                      XXXX::1                        U           -        -      -  lo0
XXXX:1::/32                        link#1                         U           -        -      -  bge0
XXXX:3::/32                        ::1                            U           -        -      -  lo0
XXXX::%bge0/32                     link#1                         U           -        -      -  bge0
XXXX::XX                           link#1                         UHL         -        -      -  bge0
XXXX::%lo0/32                      ::1                            U           -        -      -  lo0

Note that some destination addresses extend into the Gateway field, some gateway addresses extend into the Flags field; Flags and later fields do not line up.
>How-To-Repeat:
See examples in the Full description.
>Fix:
No fix at this time, but it looks like most of the issues are in /usr/src/sbin/route/rtutil.c.



Home | Main Index | Thread Index | Old Index