Date: Tue, 9 Nov 1999 22:22:03 +0000 (GMT) From: Doug Rabson <dfr@nlsystems.com> To: Rob Harris <rharris@skycache.com> Cc: freebsd-alpha@freebsd.org Subject: Re: netstat (seemingly) broken on 4.0SNAP Message-ID: <Pine.BSF.4.10.9911092221480.25540-100000@salmon.nlsystems.com> In-Reply-To: <Pine.NEB.3.95.991109091917.23675A-100000@nimbus.skycache.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9911092221480.25540-100000>