From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 12 16:10:27 2005 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E72D916A420 for ; Tue, 12 Jul 2005 16:10:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 03FF243D5C for ; Tue, 12 Jul 2005 16:10:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j6CGAOEM053846 for ; Tue, 12 Jul 2005 16:10:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j6CGAO42053845; Tue, 12 Jul 2005 16:10:24 GMT (envelope-from gnats) Resent-Date: Tue, 12 Jul 2005 16:10:24 GMT Resent-Message-Id: <200507121610.j6CGAO42053845@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "J.R. Oldroyd" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 07FB916A41C for ; Tue, 12 Jul 2005 16:05:55 +0000 (GMT) (envelope-from jr@opal.com) Received: from smtp.vzavenue.net (smtp.vzavenue.net [66.171.59.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F7C343D58 for ; Tue, 12 Jul 2005 16:05:54 +0000 (GMT) (envelope-from jr@opal.com) Received: from linwhf.opal.com (112.79.171.66.subscriber.vzavenue.net [66.171.79.112]) by smtp.vzavenue.net (MOS 3.4.8-GR) with ESMTP id CNY10581; Tue, 12 Jul 2005 12:05:12 -0400 (EDT) Received: from ASSP-nospam (localhost [127.0.0.1]) by linwhf.opal.com (8.13.3/8.13.3) with ESMTP id j6CG5CAT016164 for ; Tue, 12 Jul 2005 12:05:12 -0400 (EDT) (envelope-from jr@opal.com) Received: from 127.0.0.1 ([127.0.0.1] helo=linwhf.opal.com) by ASSP-nospam ; 12 Jul 05 16:05:12 -0000 Received: (from jr@localhost) by linwhf.opal.com (8.13.3/8.13.3/Submit) id j6CG5CEe016163; Tue, 12 Jul 2005 12:05:12 -0400 (EDT) (envelope-from jr) Message-Id: <200507121605.j6CG5CEe016163@linwhf.opal.com> Date: Tue, 12 Jul 2005 12:05:12 -0400 (EDT) From: "J.R. Oldroyd" To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/83335: update port: net/pload - change of MASTER_SITE X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: "J.R. Oldroyd" List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2005 16:10:28 -0000 >Number: 83335 >Category: ports >Synopsis: update port: net/pload - change of MASTER_SITE >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jul 12 16:10:24 GMT 2005 >Closed-Date: >Last-Modified: >Originator: J.R. Oldroyd >Release: FreeBSD 6.0-CURRENT i386 >Organization: >Environment: System: FreeBSD linwhf.opal.com 6.0-CURRENT FreeBSD 6.0-CURRENT #84: Wed Jun 8 22:31:49 EDT 2005 xxx:/usr/src-current/sys/i386/compile/LINWHF i386 >Description: Former MASTER_SITE is no longer operative, so I've changed it to use my server. Also renamed one patch file because it's name was not consistent with that of the file being patched. >How-To-Repeat: >Fix: diff -ruN /usr/ports/net/pload/Makefile net/pload/Makefile --- /usr/ports/net/pload/Makefile Mon Oct 18 16:41:21 2004 +++ net/pload/Makefile Tue Jul 12 12:01:59 2005 @@ -8,7 +8,7 @@ PORTNAME= pload PORTVERSION= 0.9.5 CATEGORIES= net sysutils -MASTER_SITES= http://www.engr.utk.edu/~mdsmith/pload/ +MASTER_SITES= http://opal.com/freebsd/ports/net/pload/ MAINTAINER= fbsd@opal.com COMMENT= An X11 program to display network traffic graphs @@ -18,6 +18,5 @@ MAN1= pload.1 MANCOMPRESSED= yes -PLIST_FILES= bin/pload .include diff -ruN /usr/ports/net/pload/files/patch-ioctl_stat.c net/pload/files/patch-ioctl_stat.c --- /usr/ports/net/pload/files/patch-ioctl_stat.c Wed Dec 31 19:00:00 1969 +++ net/pload/files/patch-ioctl_stat.c Mon Oct 18 16:41:21 2004 @@ -0,0 +1,80 @@ +--- ioctl_stat.c.orig Tue Feb 1 02:11:24 2000 ++++ ioctl_stat.c Mon Oct 18 22:32:49 2004 +@@ -30,6 +30,12 @@ + #include /* open */ + #include /* ioctl */ + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++#include ++#endif + + #ifndef STREAMS /* Linux, FreeBSD, NetBSD, Ultrix */ + # include /* socket */ +@@ -63,6 +69,16 @@ + struct ifreq ifr; + struct ifpppstatsreq req; + ++#ifdef __FreeBSD__ ++ static int if_ix = -1; ++ struct ifmibdata ifmd; ++ size_t ifmd_sz = sizeof(ifmd); ++ int nr_ifs; ++ size_t nr_ifs_sz = sizeof(nr_ifs); ++ int name[6]; ++ int i; ++#endif ++ + if (!ifd->s) getsocket(ifd); + + memset(&ifr, 0, sizeof(ifr)); +@@ -84,18 +100,36 @@ + #define ifr_name ifr__name + #endif + +- strncpy(req.ifr_name, ifd->device, sizeof(req.ifr_name)); +- if (ioctl(ifd->s, SIOCGPPPSTATS, &req) != 0) +- { +- /* shouldn't fail if SIOCGIFFLAGS worked... */ +- ifd->in_bytes = 0UL; +- ifd->out_bytes = 0UL; +- return; ++#ifdef __FreeBSD__ ++ name[0] = CTL_NET; ++ name[1] = PF_LINK; ++ name[2] = NETLINK_GENERIC; ++ name[3] = IFMIB_IFDATA; ++ name[5] = IFDATA_GENERAL; ++ ++ if (if_ix < 0) { ++ if (sysctlbyname("net.link.generic.system.ifcount", (void *) &nr_ifs, &nr_ifs_sz, (void *) 0, 0) < 0) { ++ return; ++ } ++ for (i = 1; i <= nr_ifs; i++) { ++ name[4] = i; /* row of the ifmib table */ ++ ++ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) < 0) { ++ continue; ++ } ++ if (strncmp(ifmd.ifmd_name, ifr.ifr_name, strlen(ifr.ifr_name)) == 0) { ++ if_ix = i; ++ break; ++ } ++ } + } +- +- ifd->in_bytes = (unsigned long)req.stats.p.ppp_ibytes; +- ifd->out_bytes = (unsigned long)req.stats.p.ppp_obytes; +- ++ name[4] = if_ix; ++ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) >= 0) { ++ ifd->in_bytes = ifmd.ifmd_data.ifi_ibytes; ++ ifd->out_bytes = ifmd.ifmd_data.ifi_obytes; ++ } ++#endif ++ + return; + } + diff -ruN /usr/ports/net/pload/files/patch-ioctl_stats.c net/pload/files/patch-ioctl_stats.c --- /usr/ports/net/pload/files/patch-ioctl_stats.c Mon Oct 18 16:41:21 2004 +++ net/pload/files/patch-ioctl_stats.c Wed Dec 31 19:00:00 1969 @@ -1,80 +0,0 @@ ---- ioctl_stat.c.orig Tue Feb 1 08:11:24 2000 -+++ ioctl_stat.c Mon Oct 18 22:32:49 2004 -@@ -30,6 +30,12 @@ - #include /* open */ - #include /* ioctl */ - #include -+#ifdef __FreeBSD__ -+#include -+#include -+#include -+#include -+#endif - - #ifndef STREAMS /* Linux, FreeBSD, NetBSD, Ultrix */ - # include /* socket */ -@@ -63,6 +69,16 @@ - struct ifreq ifr; - struct ifpppstatsreq req; - -+#ifdef __FreeBSD__ -+ static int if_ix = -1; -+ struct ifmibdata ifmd; -+ size_t ifmd_sz = sizeof(ifmd); -+ int nr_ifs; -+ size_t nr_ifs_sz = sizeof(nr_ifs); -+ int name[6]; -+ int i; -+#endif -+ - if (!ifd->s) getsocket(ifd); - - memset(&ifr, 0, sizeof(ifr)); -@@ -84,18 +100,36 @@ - #define ifr_name ifr__name - #endif - -- strncpy(req.ifr_name, ifd->device, sizeof(req.ifr_name)); -- if (ioctl(ifd->s, SIOCGPPPSTATS, &req) != 0) -- { -- /* shouldn't fail if SIOCGIFFLAGS worked... */ -- ifd->in_bytes = 0UL; -- ifd->out_bytes = 0UL; -- return; -+#ifdef __FreeBSD__ -+ name[0] = CTL_NET; -+ name[1] = PF_LINK; -+ name[2] = NETLINK_GENERIC; -+ name[3] = IFMIB_IFDATA; -+ name[5] = IFDATA_GENERAL; -+ -+ if (if_ix < 0) { -+ if (sysctlbyname("net.link.generic.system.ifcount", (void *) &nr_ifs, &nr_ifs_sz, (void *) 0, 0) < 0) { -+ return; -+ } -+ for (i = 1; i <= nr_ifs; i++) { -+ name[4] = i; /* row of the ifmib table */ -+ -+ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) < 0) { -+ continue; -+ } -+ if (strncmp(ifmd.ifmd_name, ifr.ifr_name, strlen(ifr.ifr_name)) == 0) { -+ if_ix = i; -+ break; -+ } -+ } - } -- -- ifd->in_bytes = (unsigned long)req.stats.p.ppp_ibytes; -- ifd->out_bytes = (unsigned long)req.stats.p.ppp_obytes; -- -+ name[4] = if_ix; -+ if (sysctl(name, 6, (void *) &ifmd, &ifmd_sz, (void *) 0, 0) >= 0) { -+ ifd->in_bytes = ifmd.ifmd_data.ifi_ibytes; -+ ifd->out_bytes = ifmd.ifmd_data.ifi_obytes; -+ } -+#endif -+ - return; - } - >Release-Note: >Audit-Trail: >Unformatted: