From owner-freebsd-alpha Tue Nov 9 14:25:11 1999 Delivered-To: freebsd-alpha@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id 95D2814C41 for ; Tue, 9 Nov 1999 14:20:51 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id WAA92425; Tue, 9 Nov 1999 22:22:03 GMT (envelope-from dfr@nlsystems.com) Date: Tue, 9 Nov 1999 22:22:03 +0000 (GMT) From: Doug Rabson To: Rob Harris Cc: freebsd-alpha@freebsd.org Subject: Re: netstat (seemingly) broken on 4.0SNAP In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, 9 Nov 1999, Rob Harris wrote: > > I assume this should not happen... > > bash-2.03# netstat -I de0 1 > input (de0) output > packets errs bytes packets errs bytes colls > 538 0 85900160452 0 0 0 0 > 397 0 85899946978 0 0 0 0 > 456 0 85900036304 0 0 0 0 > 472 0 85900057620 0 0 0 0 > 369 0 85899904586 0 0 0 0 > 448 0 85900024192 0 0 0 0 > 591 0 85900239240 0 0 0 0 > 291 0 85899785040 0 0 0 0 > 307 0 85899809264 0 0 0 0 > 469 0 85900055986 0 0 0 0 > > :) This patch should fix it: Index: if.c =================================================================== RCS file: /home/ncvs/src/usr.bin/netstat/if.c,v retrieving revision 1.29 diff -u -r1.29 if.c --- if.c 1999/10/23 17:45:11 1.29 +++ if.c 1999/11/09 22:16:11 @@ -81,7 +81,8 @@ void bdg_stats(u_long dummy, char *name) /* print bridge statistics */ { - int i, slen ; + int i; + size_t slen ; struct bdg_stats s ; int mib[4] ; @@ -353,14 +354,14 @@ #define MAXIF 10 struct iftot { char ift_name[16]; /* interface name */ - u_int ift_ip; /* input packets */ - u_int ift_ie; /* input errors */ - u_int ift_op; /* output packets */ - u_int ift_oe; /* output errors */ - u_int ift_co; /* collisions */ + u_long ift_ip; /* input packets */ + u_long ift_ie; /* input errors */ + u_long ift_op; /* output packets */ + u_long ift_oe; /* output errors */ + u_long ift_co; /* collisions */ u_int ift_dr; /* drops */ - u_int ift_ib; /* input bytes */ - u_int ift_ob; /* output bytes */ + u_long ift_ib; /* input bytes */ + u_long ift_ob; /* output bytes */ } iftot[MAXIF]; u_char signalled; /* set if alarm goes off "early" */ @@ -493,7 +494,7 @@ off = (u_long) ifnet.if_link.tqe_next; } if (!first) { - printf("%10u %5u %10u %10u %5u %10u %5u", + printf("%10lu %5lu %10lu %10lu %5lu %10lu %5lu", sum->ift_ip - total->ift_ip, sum->ift_ie - total->ift_ie, sum->ift_ib - total->ift_ib, -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message