Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/netstat Define members previously defined as u_long ...



details:   https://anonhg.NetBSD.org/src/rev/7f03c6408f45
branches:  trunk
changeset: 485098:7f03c6408f45
user:      enami <enami%NetBSD.org@localhost>
date:      Wed Apr 19 03:26:55 2000 +0000

description:
Define members previously defined as u_long in struct iftot as u_quad_t.
Since these members are used to hold members defined now as u_quad_t
in struct if_data, u_long is quite not enough actually.
Without this, one night ttcp easily makes netstat to produce wrong output
like this:
enami@annex-2f-floor-244% netstat -ibw 1 -I tlp0
   tlp0 in            tlp0 out          total in           total out
     bytes               bytes             bytes               bytes
176333740607          176914940420         240082591           821282404
176093659136          176093659136                 0                   0
176093659136          176093659136                 0                   0

diffstat:

 usr.bin/netstat/if.c |  22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r 567ad96ae187 -r 7f03c6408f45 usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c      Wed Apr 19 02:39:12 2000 +0000
+++ b/usr.bin/netstat/if.c      Wed Apr 19 03:26:55 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.39 2000/02/09 13:57:06 itojun Exp $   */
+/*     $NetBSD: if.c,v 1.40 2000/04/19 03:26:55 enami Exp $    */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.39 2000/02/09 13:57:06 itojun Exp $");
+__RCSID("$NetBSD: if.c,v 1.40 2000/04/19 03:26:55 enami Exp $");
 #endif
 #endif /* not lint */
 
@@ -384,15 +384,15 @@
 
 #define        MAXIF   100
 struct iftot {
-       char    ift_name[IFNAMSIZ];     /* interface name */
-       u_long  ift_ip;                 /* input packets */
-       u_long  ift_ib;                 /* input bytes */
-       u_long  ift_ie;                 /* input errors */
-       u_long  ift_op;                 /* output packets */
-       u_long  ift_ob;                 /* output bytes */
-       u_long  ift_oe;                 /* output errors */
-       u_long  ift_co;                 /* collisions */
-       int     ift_dr;                 /* drops */
+       char ift_name[IFNAMSIZ];        /* interface name */
+       u_quad_t ift_ip;                /* input packets */
+       u_quad_t ift_ib;                /* input bytes */
+       u_quad_t ift_ie;                /* input errors */
+       u_quad_t ift_op;                /* output packets */
+       u_quad_t ift_ob;                /* output bytes */
+       u_quad_t ift_oe;                /* output errors */
+       u_quad_t ift_co;                /* collisions */
+       int ift_dr;                     /* drops */
 } iftot[MAXIF];
 
 u_char signalled;                      /* set if alarm goes off "early" */



Home | Main Index | Thread Index | Old Index