diff options
author | wiz <wiz@pkgsrc.org> | 2007-12-09 23:41:11 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2007-12-09 23:41:11 +0000 |
commit | c414df5d948e4d91a533c21d419af44e4d0a98e3 (patch) | |
tree | 972125bd2d4be02346dd8c56e0f9037abd8f482a /net/pload/patches | |
parent | 97e44b384507669d92249bed6f0d6d56164ce5d2 (diff) | |
download | pkgsrc-c414df5d948e4d91a533c21d419af44e4d0a98e3.tar.gz |
Update to 0.9.5, provided by Sergey Svishchev in private mail:
- Fixed stats not being cleared when disconnected
- Added user specified format for labels.
- Added user customizable label for the not connected condition.
- Removed global variables in stats gathering functions.
pkgsrc fix: don't cast 64-bit counters to unsigned long.
Diffstat (limited to 'net/pload/patches')
-rw-r--r-- | net/pload/patches/patch-aa | 44 | ||||
-rw-r--r-- | net/pload/patches/patch-ab | 12 |
2 files changed, 25 insertions, 31 deletions
diff --git a/net/pload/patches/patch-aa b/net/pload/patches/patch-aa index dccb394dde9..f83c18dae3b 100644 --- a/net/pload/patches/patch-aa +++ b/net/pload/patches/patch-aa @@ -1,30 +1,25 @@ -$NetBSD: patch-aa,v 1.3 2002/05/24 18:12:36 martin Exp $ +$NetBSD: patch-aa,v 1.4 2007/12/09 23:41:11 wiz Exp $ ---- ioctl_stat.c.orig Thu Mar 4 08:33:03 1999 -+++ ioctl_stat.c Fri May 24 20:03:05 2002 -@@ -68,6 +68,13 @@ - +--- ioctl_stat.c.orig 2000-02-01 07:11:24.000000000 +0000 ++++ ioctl_stat.c +@@ -61,6 +61,10 @@ void getsocket(if_data *ifd) void ioctl_stat(if_data *ifd) { -+#ifdef __NetBSD__ -+ struct ifreq ifr; + struct ifreq ifr; +#ifdef SIOCGIFDATA + struct ifdatareq ifdr; + struct if_data * const ifi = &ifdr.ifdr_data; +#endif -+#endif struct ifpppstatsreq req; - if (s < 0) getsocket(); -@@ -78,8 +85,33 @@ + if (!ifd->s) getsocket(ifd); +@@ -84,6 +88,31 @@ void ioctl_stat(if_data *ifd) #define ifr_name ifr__name - req.stats_ptr = (caddr_t) &req.stats; - #endif -- sprintf(req.ifr_name, ifd->device); - + #endif + +#ifdef __NetBSD__ -+ sprintf(ifr.ifr_name, ifd->device); -+ if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0 || ++ strncpy(ifr.ifr_name, ifd->device, sizeof(ifr.ifr_name)); ++ if (ioctl(ifd->s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0 || + !(ifr.ifr_flags&IFF_UP)) + { + /* invalid interface, or interface down */ @@ -35,23 +30,22 @@ $NetBSD: patch-aa,v 1.3 2002/05/24 18:12:36 martin Exp $ +#endif + +#if defined(__NetBSD__) && defined(SIOCGIFDATA) -+ /* prefere the generic interface statistics over the PPP specific ones */ ++ /* prefer the generic interface statistics over the PPP specific ones */ + strncpy(ifdr.ifdr_name, ifd->device, sizeof(ifdr.ifdr_name)); -+ if (ioctl(s, SIOCGIFDATA, &ifdr) == -1) ++ if (ioctl(ifd->s, SIOCGIFDATA, &ifdr) == -1) + { -+ /* non-existant device? */ ++ /* non-existent device? */ + ifd->in_bytes = 0UL; + ifd->out_bytes = 0UL; + return; + } -+ ifd->in_bytes = (unsigned long)ifi->ifi_ibytes; -+ ifd->out_bytes = (unsigned long)ifi->ifi_obytes; ++ ifd->in_bytes = ifi->ifi_ibytes; ++ ifd->out_bytes = ifi->ifi_obytes; +#else -+ sprintf(req.ifr_name, ifd->device); - if (ioctl(s, SIOCGPPPSTATS, &req) != 0) + strncpy(req.ifr_name, ifd->device, sizeof(req.ifr_name)); + if (ioctl(ifd->s, SIOCGPPPSTATS, &req) != 0) { - /* non-existant device? */ -@@ -90,6 +122,7 @@ +@@ -95,6 +124,7 @@ void ioctl_stat(if_data *ifd) ifd->in_bytes = (unsigned long)req.stats.p.ppp_ibytes; ifd->out_bytes = (unsigned long)req.stats.p.ppp_obytes; diff --git a/net/pload/patches/patch-ab b/net/pload/patches/patch-ab index a15efcd6d69..ed4238c17a9 100644 --- a/net/pload/patches/patch-ab +++ b/net/pload/patches/patch-ab @@ -1,13 +1,13 @@ -$NetBSD: patch-ab,v 1.1 2002/01/03 09:07:29 hubertf Exp $ +$NetBSD: patch-ab,v 1.2 2007/12/09 23:41:11 wiz Exp $ ---- Imakefile.orig Thu Mar 4 08:33:03 1999 +--- Imakefile.orig 2000-02-01 07:11:24.000000000 +0000 +++ Imakefile -@@ -15,7 +15,7 @@ +@@ -15,7 +15,7 @@ DEFINES = -DVERSION="\"Pload version $(V ComplexProgramTarget(pload) -distclean: clean +distclean:: clean - $(RM) Makefile osdefs.mk core - - tgz: + $(RM) Makefile osdefs.mk core \ + pload-$(VER).tar.gz \ + pload-$(VER)-1.i386.rpm \ |