pkgsrc-Bugs archive

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

pkg/38168: net/pload: counters wrap at 4GB



>Number:         38168
>Category:       pkg
>Synopsis:       net/pload: counters wrap at 4GB
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 05 00:45:01 +0000 2008
>Originator:     Sergey Svishchev
>Release:        4.0
>Organization:
>Environment:
>Description:
An internal structure still uses 'unsigned long' for counters; fix: use 
u_quad_t on NetBSD.

>How-To-Repeat:
Use pload on Ethernet interface with (lots of) traffic.
>Fix:
Index: net/pload/Makefile
===================================================================
RCS file: /vol/1/cvsup/pkgsrc/net/pload/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- net/pload/Makefile  9 Dec 2007 23:41:11 -0000       1.20
+++ net/pload/Makefile  20 Jan 2008 19:36:06 -0000
@@ -2,6 +2,7 @@
 #
 
 DISTNAME=      pload-0.9.5
+PKGREVISION=   1
 CATEGORIES=    net x11
 MASTER_SITES=  ${MASTER_SITE_SUNSITE:=system/network/serial/ppp/}
 
Index: net/pload/distinfo
===================================================================
RCS file: /vol/1/cvsup/pkgsrc/net/pload/distinfo,v
retrieving revision 1.7
diff -u -r1.7 distinfo
--- net/pload/distinfo  9 Dec 2007 23:41:11 -0000       1.7
+++ net/pload/distinfo  20 Jan 2008 19:37:36 -0000
@@ -6,3 +6,5 @@
 SHA1 (patch-aa) = 6a30a15c60e74eeb5312e275b1dac882c86b2420
 SHA1 (patch-ab) = 4bf2639b64d20717716c66be85c4fb5cd3b114d5
 SHA1 (patch-ac) = 345ac88bb5d279039ae0169c2b468b22964a0c09
+SHA1 (patch-ad) = 97e7f37561882098b080683237e661f2f5692025
+SHA1 (patch-ae) = d98a346e56d36eb5efd084eef1a95ca6c350c0f5
Index: net/pload/patches/patch-ad
===================================================================
RCS file: net/pload/patches/patch-ad
diff -N net/pload/patches/patch-ad
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/pload/patches/patch-ad  20 Jan 2008 19:37:15 -0000
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- pload.h.orig       2000-02-01 07:11:24.000000000 +0000
++++ pload.h
+@@ -35,10 +35,17 @@ struct if_dat
+ #ifdef LINUXPROC
+       FILE *file;                             /* /proc/net/dev        */
+ #endif        
++#ifdef __NetBSD__
++      u_quad_t in_bytes;                      /* total bytes in       */
++      u_quad_t in_bytes_old;                  /* last total bytes in  */
++      u_quad_t out_bytes;                     /* total bytes out      */
++      u_quad_t out_bytes_old;                 /* last total byts out  */
++#else
+       unsigned long in_bytes;                 /* total bytes in       */
+       unsigned long in_bytes_old;             /* last total bytes in  */
+       unsigned long out_bytes;                /* total bytes out      */
+       unsigned long out_bytes_old;            /* last total byts out  */
++#endif
+       struct timeval prev_time;               /* last time            */
+       struct timeval curr_time;               /* time now             */
+       int history_size;                       /* # pts to average over*/
Index: net/pload/patches/patch-ae
===================================================================
RCS file: net/pload/patches/patch-ae
diff -N net/pload/patches/patch-ae
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ net/pload/patches/patch-ae  20 Jan 2008 19:37:22 -0000
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- pload.c.orig       2000-02-01 07:11:24.000000000 +0000
++++ pload.c
+@@ -40,7 +40,11 @@ static void HandleExit(void);
+ static void CheckForWMExit(Widget, XtPointer, XEvent*, Boolean*);
+ static void CheckForIconState(Widget, XtPointer, XEvent*, Boolean*);
+ static void update(XtPointer, XtIntervalId*);
++#ifdef __NetBSD__
++static void make_label(char*,u_quad_t,double,double);
++#else
+ static void make_label(char*,unsigned long,double,double);
++#endif
+ static void do_rate(char*,double);
+ static void do_total(char*, double);
+ 
+@@ -621,7 +625,11 @@ void do_rate(char *b, double rate)
+ }
+ 
+ /* stores label in global 'buff' */
++#ifdef __NetBSD__
++void make_label(char *fmt, u_quad_t total, double rate, double max)
++#else
+ void make_label(char *fmt, unsigned long total, double rate, double max)
++#endif
+ {
+       char *p;
+       int i;



Home | Main Index | Thread Index | Old Index