Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Aug 2000 12:41:19 -0700 (PDT)
From:      imp@village.org
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/20808: netstat -m doesn't use -N or -M arguments, nor warn about it
Message-ID:  <20000823194119.0F9CD37B43E@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         20808
>Category:       misc
>Synopsis:       netstat -m doesn't use -N or -M arguments, nor warn about it
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 23 12:50:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Warner Losh
>Release:        FreeBSD -current
>Organization:
FreeBSD
>Environment:
>Description:
The netstat -m option reports the number of mbuf in use.  Netstat -N and -M
allow for specification of a core and kernel file to use rather than the 
current running system.  The mbuf stat code in mbuf.h (specifically mbpr)
doesn't fallback to getting the information from core file.  Nor
does it warn about it :-(
>How-To-Repeat:
Run netstat -m -N xxxx -M yyyy on a core file.  Run it many times.
Watch the numbers change.
>Fix:
Sadly, all I have is the following:, which I'll commit, but it doesn't
fix the actual bug.  Note, I did a bad thing and cut/paste tabs
so they are likely gone.  But this is for reference only.

Index: main.c
===================================================================
RCS file: /base/FreeBSD-CVS/src/usr.bin/netstat/main.c,v
retrieving revision 1.23.2.5
diff -u -r1.23.2.5 main.c
--- main.c      2000/03/20 18:34:54     1.23.2.5
+++ main.c      2000/08/23 18:58:36
@@ -346,6 +346,8 @@
                setgid(getgid());
 
        if (mflag) {
+               if (nlistf != NULL || memf != NULL)
+                       err("Cannot obtain mbuf stats from a core file");
                mbpr();
                exit(0);
        }


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000823194119.0F9CD37B43E>