Subject: bin/3129: netstat -I netmask output wrong on litte-endian machines
To: None <gnats-bugs@gnats.netbsd.org>
From: Charlie Root <root@Tandoor.DSG.Stanford.EDU>
List: netbsd-bugs
Date: 01/20/1997 17:51:31
>Number:         3129
>Category:       bin
>Synopsis:       netstat -I netmask output wrong on litte-endian machines
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 20 18:05:01 1997
>Last-Modified:
>Originator:     Jonathan Stone
>Organization:
	Stanford DSG
>Release:        NetBSD-current at Jan 11 1997
>Environment:
	
System: NetBSD Tandoor.DSG.Stanford.EDU 1.2B NetBSD 1.2B (DSG_4K.prof) #5: Mon Jan 20 17:38:50 PST 1997 jonathan@Cup.DSG.Stanford.EDU:/aga/n1/src/NetBSD/IP-PLUS/src/sys/arch/i386/compile/DSG_4K.prof i386


>Description:
	Netstat -I <interface> prints netmasks, but on
	an i386 the netmasks printed are wrong.

>How-To-Repeat:

Configure network interface on an i386 with non-octet aligned
 subnet masks.
Compare the results of ifconfig -a, and netstat -I for each interface.

The following is from a machine with two interfaces with 
netmasks of 255.255.255.128. One interface is on a class B net,
the other on net 10:

>From ifconfig  -a:

	Tandoor# ifconfig -a
	ep1: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
	        inet 171.64.79.100 netmask 0xffffff80 broadcast 171.64.79.127
	vassa0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST>
	        inet 10.0.0.1 netmask 0xffffff80 broadcast 10.0.0.127

>From  netstat -i:

Tandoor# netstat -I ep1
Name  Mtu   Network     Address              Ipkts Ierrs    Opkts Oerrs  Coll
ep1   1500  171.64.79&0 Tandoor               5554     0     6357     0     0

Tandoor# netstat -I va0
Name  Mtu   Network     Address              Ipkts Ierrs    Opkts Oerrs  Coll
va0   4096  10&0x80ffff 10.0.0.1            687139     0   687053     0     0


>Fix:
I haven't looked :).
>Audit-Trail:
>Unformatted: