From nobody@FreeBSD.ORG  Mon Sep 25 17:06:45 2000
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 51A6537B422; Mon, 25 Sep 2000 17:06:45 -0700 (PDT)
Message-Id: <20000926000645.51A6537B422@hub.freebsd.org>
Date: Mon, 25 Sep 2000 17:06:45 -0700 (PDT)
From: frank@google.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@FreeBSD.org
Subject: netstat -rn output needs netmask info added
X-Send-Pr-Version: www-1.0

>Number:         21546
>Category:       bin
>Synopsis:       netstat -rn output needs netmask info added
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 25 17:10:01 PDT 2000
>Closed-Date:    Fri Jun 8 08:43:34 PDT 2001
>Last-Modified:  Fri Jun 08 08:46:05 PDT 2001
>Originator:     Frank Cusack
>Release:        4.1-RELEASE
>Organization:
Google
>Environment:
i386
>Description:
If I have fxp0 as 192.168.0.x/24, netstat -rn -f inet shows this route as

192.168		link#1 ...

which makes you think it is a /16.
>How-To-Repeat:
`ifconfig fxp0 192.168.0.1 netmask 255.255.255.0; netstat -rn -f inet'
>Fix:
netstat needs to report netmasks explicitly, and expand the destination
IP to at least the prefix length (if not all 4 octets).

eg:

192.168.0/24	link#1	...

or

192.168.0.0/24	link#1	...


>Release-Note:
>Audit-Trail:

From: Ruslan Ermilov <ru@sunbay.com>
To: frank@google.com
Cc: bug-followup@FreeBSD.org
Subject: Re: bin/21546: netstat -rn output needs netmask info added
Date: Tue, 26 Sep 2000 10:51:34 +0300

 On Mon, Sep 25, 2000 at 05:06:45PM -0700, frank@google.com wrote:
 > 
 > If I have fxp0 as 192.168.0.x/24, netstat -rn -f inet shows this route as
 > 
 > 192.168		link#1 ...
 > 
 > which makes you think it is a /16.
 > 
 No, it does not, because I know that the standard netmask for class C
 network is /24.  In other words, netstat(1) does not output the netmask
 for a network route unless it is different from the default netmask for
 this network's class, IN_CLASS[ABC]_NET (see /usr/include/netinet/in.h).
 
 -- 
 Ruslan Ermilov		Oracle Developer/DBA,
 ru@sunbay.com		Sunbay Software AG,
 ru@FreeBSD.org		FreeBSD committer,
 +380.652.512.251	Simferopol, Ukraine
 
 http://www.FreeBSD.org	The Power To Serve
 http://www.oracle.com	Enabling The Information Age
 
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Fri Jun 8 08:43:34 PDT 2001 
State-Changed-Why:  
Fixed in 5.0-CURRENT, in netstat/route.c,v 1.49. 
netstat(1) now prints at least 2 bytes for class B 
networks and at least 3 bytes for class C networks. 
MFC into 4.3-STABLE within a week. 


Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: ru 
Responsible-Changed-When: Fri Jun 8 08:43:34 PDT 2001 
Responsible-Changed-Why:  
The fix was mine. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=21546 
>Unformatted:
