Subject: bin/32632: Improvment suggestion in 'route' display
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <yves-emmanuel.jutard@fr.thalesgroup.com>
List: netbsd-bugs
Date: 01/25/2006 16:10:00
>Number:         32632
>Category:       bin
>Synopsis:       Improvment suggestion in 'route' display
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 25 16:10:00 +0000 2006
>Originator:     Yves-Emmanuel JUTARD
>Release:        3.0.0
>Organization:
THALES Communication
>Environment:
custom environment : recompiled from /src, only some parts of NetBSD are used (TCP/IP stack and some parts of the kernel)
>Description:
type 'route -n show'
In the last column, 'flags' are displayed as letters being put one after another :
route -n show
Routing tables

Internet:
Destination       Gateway            Flags
0.0.0.0/8         default            U
127.0.0.0/-7      127.0.0.1          UGR
127.0.0.1         127.0.0.1          UH
192.0.0.0/8       link#2             U
192.40.34.33      link#2             UH
192.40.34.110     00:60:08:72:xx:xx  UH

This make difficult to compare flags between lines, as stated in "TCP/IP Illustrated, volume 2", chapter 18.2

With a slight modification, one can have this :
route -n show
Routing tables

Internet:
Destination       Gateway            Flags
0.0.0.0/8         default            U
127.0.0.0/-7      127.0.0.1          UG R
127.0.0.1         127.0.0.1          U H
192.0.0.0/8       link#2             U
192.40.34.33      link#2             U H
192.40.34.110     00:60:08:72:xx:xx  U H

Here, when a flag is missing, a blank is inserted instead. It's then easier to spot which flags are set and which one are'nt. It's also easier to compare lines.
>How-To-Repeat:
type 'route -n show' on a machine with internet interfaces.
'netstat' utility may also be affected.

>Fix:
in sbin/route/show.c, after line 324
			*flags++ = p->b_val;
insert those two lines
		else
			*flags++ = ' ';