From nobody@FreeBSD.org  Sat May 12 02:15:43 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 1512137B424
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 12 May 2001 02:15:43 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f4C9FhC73856;
	Sat, 12 May 2001 02:15:43 -0700 (PDT)
	(envelope-from nobody)
Message-Id: <200105120915.f4C9FhC73856@freefall.freebsd.org>
Date: Sat, 12 May 2001 02:15:43 -0700 (PDT)
From: kar_alerts@mglorysb.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: netstat -rn prints "kvm_read: Bad Address" 
X-Send-Pr-Version: www-1.0

>Number:         27280
>Category:       i386
>Synopsis:       netstat -rn prints "kvm_read: Bad Address"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    ru
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat May 12 02:20:00 PDT 2001
>Closed-Date:    Mon May 14 01:24:23 PDT 2001
>Last-Modified:  Mon May 14 08:10:02 PDT 2001
>Originator:     Karthik
>Release:        4.3-STABLE
>Organization:
MGSB
>Environment:
FreeBSD svr.mgsb.domain 4.3-STABLE FreeBSD 4.3-STABLE #0: Fri May 11 22:41:02 GM
T 2001     root@svr.mgsb.domain:/usr/src/sys/compile/SVRFW  i386
>Description:
when i give "netstat -rn", the system prints:

inet4 section:

*** -- message start -- ****
Routing tables

Internet:
Destination        Gateway            Flags     Refs     Use     Netif Expire
default            161.142.113.3      UGSc       54      993     tun0
127.0.0.1          127.0.0.1          UH          0      947      lo0
161.142.113.3      202.187.194.33     UH         52        0     tun0
192.168            link#1             UC          0        0      xl0 =>
netstat: kvm_read: Bad address
192.168.0.1        0:50:4:d2:ec:5     UHLW        2      918      lo0
netstat: kvm_read: Bad address
192.168.0.101      0:10:a4:e8:45:3    UHLW        5   521930      xl0    999
netstat: kvm_read: Bad address
192.168.0.102      0:0:b4:85:a2:f6    UHLW        0     1481      xl0    610
netstat: kvm_read: Bad address
192.168.0.201      0:0:b4:9d:5:4a     UHLW        1     1473      xl0    465
netstat: kvm_read: Bad address
192.168.0.202      0:50:4:b8:16:f3    UHLW        1  2015523      xl0     55
netstat: kvm_read: Bad address
192.168.0.255      ff:ff:ff:ff:ff:ff  UHLWb       2       39      xl0          

*** -- message end -- ****

please note the message "netstat: kvm_read: Bad address" in the above output.



>How-To-Repeat:
type netstat -rn
>Fix:
don't know
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@orbitel.bg>
To: kar_alerts@mglorysb.com
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: i386/27280: netstat -rn prints "kvm_read: Bad Address"
Date: Sat, 12 May 2001 12:34:14 +0300

 On Sat, May 12, 2001 at 02:15:43AM -0700, kar_alerts@mglorysb.com wrote:
 > 
 > >Number:         27280
 > >Category:       i386
 > >Synopsis:       netstat -rn prints "kvm_read: Bad Address"
 > >Originator:     Karthik
 > >Release:        4.3-STABLE
 > >Organization:
 > MGSB
 > >Environment:
 > FreeBSD svr.mgsb.domain 4.3-STABLE FreeBSD 4.3-STABLE #0: Fri May 11 22:41:02 GM
 > T 2001     root@svr.mgsb.domain:/usr/src/sys/compile/SVRFW  i386
 > >Description:
 > when i give "netstat -rn", the system prints:
 > 
 > inet4 section:
 > 
 > *** -- message start -- ****
 > Routing tables
 > 
 > Internet:
 > Destination        Gateway            Flags     Refs     Use     Netif Expire
 > default            161.142.113.3      UGSc       54      993     tun0
 > 127.0.0.1          127.0.0.1          UH          0      947      lo0
 > 161.142.113.3      202.187.194.33     UH         52        0     tun0
 > 192.168            link#1             UC          0        0      xl0 =>
 > netstat: kvm_read: Bad address
 > 192.168.0.1        0:50:4:d2:ec:5     UHLW        2      918      lo0
 > netstat: kvm_read: Bad address
 > 192.168.0.101      0:10:a4:e8:45:3    UHLW        5   521930      xl0    999
 > netstat: kvm_read: Bad address
 > 192.168.0.102      0:0:b4:85:a2:f6    UHLW        0     1481      xl0    610
 > netstat: kvm_read: Bad address
 > 192.168.0.201      0:0:b4:9d:5:4a     UHLW        1     1473      xl0    465
 > netstat: kvm_read: Bad address
 > 192.168.0.202      0:50:4:b8:16:f3    UHLW        1  2015523      xl0     55
 > netstat: kvm_read: Bad address
 > 192.168.0.255      ff:ff:ff:ff:ff:ff  UHLWb       2       39      xl0          
 > 
 > *** -- message end -- ****
 > 
 > please note the message "netstat: kvm_read: Bad address" in the above output.
 
 Confirmed here, on a 4.3-STABLE system rebuilt yesterday.
 
 Can you try the attached patch and see if it helps?
 
 G'luck,
 Peter
 
 -- 
 I've heard that this sentence is a rumor.
 
 Index: src/usr.bin/netstat/route.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/netstat/route.c,v
 retrieving revision 1.41.2.6
 diff -u -r1.41.2.6 route.c
 --- src/usr.bin/netstat/route.c	2001/05/10 08:26:46	1.41.2.6
 +++ src/usr.bin/netstat/route.c	2001/05/12 09:33:20
 @@ -591,7 +591,7 @@
  	/*
  	 * Don't print protocol-cloned routes unless -a.
  	 */
 -	if (rt->rt_flags & RTF_WASCLONED && !aflag) {
 +	if (rt->rt_flags & RTF_WASCLONED && rt->rt_parent != NULL && !aflag) {
  		kget(rt->rt_parent, parent);
  		if (parent.rt_flags & RTF_PRCLONING)
  			return;
Responsible-Changed-From-To: freebsd-bugs->ru 
Responsible-Changed-By: roam 
Responsible-Changed-When: Sat May 12 03:39:29 PDT 2001 
Responsible-Changed-Why:  
Ruslan touched this part of the code in his last route cloning handling commit. 
Apparently, there are cases when a route is marked as cloned, yet has no parent 
set.  The originator reported (in a mail CC'd to -bugs, not GNATS) that 
the patch in the audit trail solved his problem (as it did mine). 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27280 

From: Peter Pentchev <roam@orbitel.bg>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/27280: netstat -rn prints "kvm_read: Bad Address"
Date: Sat, 12 May 2001 13:42:22 +0300

 Just for the record, let GNATS have this, too.
 
 G'luck,
 Peter
 
 -- 
 This inert sentence is my body, but my soul is alive, dancing in the sparks of your brain.
 
 ----- Forwarded message from K Karthik <kar_alerts@mglorysb.com> -----
 
 From: K Karthik <kar_alerts@mglorysb.com>
 Reply-To: kar_alerts@mglorysb.com
 To: Peter Pentchev <roam@orbitel.bg>
 Subject: Re: i386/27280: netstat -rn prints "kvm_read: Bad Address"
 Date: Sat, 12 May 2001 17:56:38 +0000
 Cc: freebsd-bugs@FreeBSD.ORG
 
 Patch worked well. Problem SOLVED.
 
 Thank you very much.

From: Samuel Greear <sgreear@vsni.com>
To: freebsd-gnats-submit@FreeBSD.org, kar_alerts@mglorysb.com
Cc:  
Subject: Re: i386/27280: netstat -rn prints "kvm_read: Bad Address"
Date: Sun, 13 May 2001 10:28:04 -0700

 Tested, works.
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Mon May 14 01:24:23 PDT 2001 
State-Changed-Why:  
Fixed in sys/net/route.c,v 1.59.2.2. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=27280 

From: Peter Pentchev <roam@orbitel.bg>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: i386/27280: netstat -rn prints "kvm_read: Bad Address"
Date: Mon, 14 May 2001 17:59:50 +0300

 On Mon, May 14, 2001 at 11:27:36AM +0300, Ruslan Ermilov wrote:
 [snip]
 > Fixed now, I didn't realize I have uncommitted code running on my -STABLE box.
 
 Yes, netstat -r works just fine now on RELENG_4 for me, even without
 the patch in the audit trail.  Thanks!
 
 Now I guess it's up to the PR originator to confirm netstat works
 fine for him, too :)
 
 G'luck,
 Peter
 
 -- 
 If there were no counterfactuals, this sentence would not have been paradoxical.
>Unformatted:
