From j@ida.interface-business.de  Wed Jan 31 07:37:34 1996
Received: from innocence.interface-business.de (innocence.interface-business.de [193.101.57.101])
          by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id HAA09480
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 Jan 1996 07:37:31 -0800 (PST)
Received: from ida.interface-business.de (ida.interface-business.de [193.101.57.203]) by innocence.interface-business.de (8.6.11/8.6.9) with SMTP id QAA28566 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 31 Jan 1996 16:43:18 +0100
Received: (from j@localhost) by ida.interface-business.de (8.7.3/8.7.3) id QAA26772; Wed, 31 Jan 1996 16:36:51 +0100 (MET)
Message-Id: <199601311536.QAA26772@ida.interface-business.de>
Date: Wed, 31 Jan 1996 16:36:51 +0100 (MET)
From: J Wunsch <j@ida.interface-business.de>
Reply-To: joerg_wunsch@interface-business.de
To: FreeBSD-gnats-submit@freebsd.org
Subject: Bogus output from netstat -r
X-Send-Pr-Version: 3.2

>Number:         982
>Category:       bin
>Synopsis:       Bogus output from netstat -r
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 31 07:40:05 PST 1996
>Closed-Date:    Thu Feb 1 09:34:34 PST 1996
>Last-Modified:  Thu Feb  1 09:36:07 PST 1996
>Originator:     J Wunsch
>Release:        FreeBSD 2.2-CURRENT i386
>Organization:
interface business GmbH
>Environment:

System from early January 1996.  External router to the Internet.

>Description:

Some of the lines from the netstat -rn output look rather suspicous:

j@ida 506% netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            193.101.57.254     UGc         6       44       ed1
127.0.0.1          127.0.0.1          UH          2     2564       lo0
192.168.238&0xc0a8ee00 193.101.57.253     UGc         0        0       ed1
193.98.238&0xc162ee00 193.101.57.253     UGc         0        0       ed1
193.101.57.0       link#1             UHLW        1     1347 
193.101.57         link#1             UC          1        0 
193.101.57.101     0:0:c0:33:37:65    UHLW        9   372572       ed1   1171
193.101.57.114     0:20:af:f9:ad:fc   UHLW        0     2239       ed1   1006
193.101.57.200     0:0:c0:6b:2b:a3    UHLW        4   322930       ed1   1092
193.101.57.203     0:0:c0:28:c3:63    UHLW        3     8684       lo0
193.101.57.254     0:c0:7b:50:4f:ee   UHLW        8     1856       ed1   1143
193.101.57.255     link#1             UHLW        1     1346 
194.115.141&0xc2738d00 193.101.57.254     UGc         0        0       ed1
224/4              link#1             UCS         0        0 

...as compared to a machine running 2.0.5 in the same network:

[...]
192.168.238      193.101.57.253     UGc         0        0       ed0
193.98.238       193.101.57.253     UGc         0        0       ed0
[...]
194.115.141      193.101.57.254     UGc         0        0       ed0
224              link#1             UCS         0        0 


>How-To-Repeat:

No idea how this happens.

>Fix:
>Release-Note:
>Audit-Trail:

From: "Garrett A. Wollman" <wollman@lcs.mit.edu>
To: joerg_wunsch@interface-business.de
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: bin/982: Bogus output from netstat -r
Date: Wed, 31 Jan 1996 14:33:45 -0500

 <<On Wed, 31 Jan 1996 16:36:51 +0100 (MET), J Wunsch <j@ida.interface-business.de> said:
 
 > 192.168.238&0xc0a8ee00 193.101.57.253     UGc         0        0       ed1
 
 Your netmaks is wrong.  Some program mistakenly did the equivalent of:
 
 # route add 192.168.238.0 -netmask 193.168.238.0 -nostatic
 
 -GAWollman
 
 --
 Garrett A. Wollman   | Shashish is simple, it's discreet, it's brief. ... 
 wollman@lcs.mit.edu  | Shashish is the bonding of hearts in spite of distance.
 Opinions not those of| It is a bond more powerful than absence.  We like people
 MIT, LCS, ANA, or NSA| who like Shashish.  - Claude McKenzie + Florent Vollant

From: J Wunsch <j@ida.interface-business.de>
To: wollman@lcs.mit.edu (Garrett A. Wollman)
Cc: joerg_wunsch@interface-business.de, FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/982: Bogus output from netstat -r
Date: Thu, 1 Feb 1996 01:12:32 +0100 (MET)

 As Garrett A. Wollman wrote:
 > 
 > > 192.168.238&0xc0a8ee00 193.101.57.253     UGc         0        0       ed1
 > 
 > Your netmaks is wrong.  Some program mistakenly did the equivalent of:
 > 
 > # route add 192.168.238.0 -netmask 193.168.238.0 -nostatic
 
 This could only be routed then.  I'm using the lazy ``route -q''
 way.
 
 -- 
 J"org Wunsch					       Unix support engineer
 joerg_wunsch@interface-business.de
 					[private: http://www.sax.de/~joerg/]

From: Bill Fenner <fenner@parc.xerox.com>
To: joerg_wunsch@interface-business.de
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/982: Bogus output from netstat -r 
Date: Wed, 31 Jan 1996 16:50:26 PST

 How-To-Repeat:
  
 run routed in a non-class A network.
 
 Joerg, please try this routed patch.
 
 Index: inet.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/routed/inet.c,v
 retrieving revision 1.1.1.1
 diff -c -r1.1.1.1 inet.c
 *** inet.c	1994/05/26 06:39:03	1.1.1.1
 --- inet.c	1996/02/01 00:46:53
 ***************
 *** 143,155 ****
   	} else if (IN_CLASSA(i)) {
   		mask = IN_CLASSA_NET;
   	} else if (IN_CLASSB(i)) {
 ! 		mask = i & IN_CLASSB_NET;
   	} else
 ! 		mask = i & IN_CLASSC_NET;
   
   	/*
   	 * Check whether network is a subnet;
 ! 	 * if so, use the modified interpretation of `host'.
   	 */
   	for (ifp = ifnet; ifp; ifp = ifp->int_next)
   		if ((ifp->int_netmask & i) == ifp->int_net)
 --- 143,155 ----
   	} else if (IN_CLASSA(i)) {
   		mask = IN_CLASSA_NET;
   	} else if (IN_CLASSB(i)) {
 ! 		mask = IN_CLASSB_NET;
   	} else
 ! 		mask = IN_CLASSC_NET;
   
   	/*
   	 * Check whether network is a subnet;
 ! 	 * if so, use the modified interpretation of `subnet'.
   	 */
   	for (ifp = ifnet; ifp; ifp = ifp->int_next)
   		if ((ifp->int_netmask & i) == ifp->int_net)

From: J Wunsch <j@ida.interface-business.de>
To: fenner@parc.xerox.com (Bill Fenner)
Cc: joerg_wunsch@interface-business.de, FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/982: Bogus output from netstat -r
Date: Thu, 1 Feb 1996 13:20:11 +0100 (MET)

 As Bill Fenner wrote:
 > 
 > 
 > How-To-Repeat:
 >  
 > run routed in a non-class A network.
 > 
 > Joerg, please try this routed patch.
 
 It works, thanks allot!
 
 -- 
 J"org Wunsch					       Unix support engineer
 joerg_wunsch@interface-business.de
 					[private: http://www.sax.de/~joerg/]
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Thu Feb 1 09:34:34 PST 1996 
State-Changed-Why:  
routed was installing routes with bogus netmasks. 
Fixed in usr.sbin/routed/inet.c version 1.2 
>Unformatted:
