NetBSD Problem Report #50027

From www@NetBSD.org  Fri Jul  3 05:04:24 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id D11F0A57FE
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  3 Jul 2015 05:04:23 +0000 (UTC)
Message-Id: <20150703050422.4F123A6554@mollari.NetBSD.org>
Date: Fri,  3 Jul 2015 05:04:22 +0000 (UTC)
From: ozaki-r@netbsd.org
Reply-To: ozaki-r@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: netstat -r/route show don't show Refs and Use columns
X-Send-Pr-Version: www-1.0

>Number:         50027
>Category:       kern
>Synopsis:       netstat -r/route show don't show Refs and Use columns
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 03 05:05:00 +0000 2015
>Originator:     Ryota Ozaki
>Release:        current
>Organization:
>Environment:
NetBSD rangeley 7.99.19 NetBSD 7.99.19 (RANGELEY) #2: Fri Jul  3 13:08:43 JST 2015  ozaki-r@rangeley:(hidden) amd64
>Description:
netstat -r and route show (they use a common code and their outputs are almost
the same now) always show "-" for Refs and Use columns. netstat -r on NetBSD 6.0
was able to show Refs and Use properly.

netbsd6# netstat -nr -f inet |grep -e 127.0.0.1 -e Refs
Destination        Gateway            Flags    Refs      Use    Mtu Interface
127/8              127.0.0.1          UGRS        0        0  33648  lo0
127.0.0.1          127.0.0.1          UH          2      114  33648  lo0

current# netstat -nr -f inet |grep -e 127.0.0.1 -e Refs
Destination        Gateway            Flags    Refs      Use    Mtu Interface
127/8              127.0.0.1          UGRS        -        -  33648  lo0
127.0.0.1          127.0.0.1          UHl         -        -  33648  lo0

Refs and Use are useful for debugging and tests. We should get them back.
>How-To-Repeat:
Run netstat -r or route show.
>Fix:
If we consider only -current, we can fix the problem by adding rtm_refcnt
to struct rt_msghdr and doing rtm->rtm_refcnt = rt->rt_refcnt in
sysctl_dumpentry. However, if we take into account of compat, the problem
is not so easy to fix.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.