From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Feb 13 22:00:04 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBCD16A420 for ; Wed, 13 Feb 2008 22:00:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id ECDFD13C4E1 for ; Wed, 13 Feb 2008 22:00:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1DM03mb002217 for ; Wed, 13 Feb 2008 22:00:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1DM03nw002211; Wed, 13 Feb 2008 22:00:03 GMT (envelope-from gnats) Resent-Date: Wed, 13 Feb 2008 22:00:03 GMT Resent-Message-Id: <200802132200.m1DM03nw002211@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, Mike Tancsa Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D99BD16A56E for ; Wed, 13 Feb 2008 21:54:22 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 2031313C45A for ; Wed, 13 Feb 2008 21:54:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1DLq2KY083036 for ; Wed, 13 Feb 2008 21:52:02 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m1DLq2fY083035; Wed, 13 Feb 2008 21:52:02 GMT (envelope-from nobody) Message-Id: <200802132152.m1DLq2fY083035@www.freebsd.org> Date: Wed, 13 Feb 2008 21:52:02 GMT From: Mike Tancsa To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/120625: Bug in ifstat for AMD64 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2008 22:00:04 -0000 >Number: 120625 >Category: ports >Synopsis: Bug in ifstat for AMD64 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 13 22:00:03 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Mike Tancsa >Release: RELENG_7 AMD64 >Organization: Sentex >Environment: FreeBSD ns8.recycle.net 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #3: Wed Feb 13 11:51:23 EST 2008 mdtancsa@ns8.recycle.net:/usr/obj/usr/src/sys/db amd64 >Description: A type error in ifstat prevents it from working on amd64 According to the thread in http://lists.freebsd.org/pipermail/freebsd-stable/2008-February/040478.html The type to the fourth argument to sysctl is wrong (int) and should be size_t. >How-To-Repeat: on a releng_7 box that is AMD64 make and install /usr/ports/net/ifstat and run it [ns8]# ifstat -b ifstat: no interfaces to monitor! [ns8]# With the patch, all works as expected. >Fix: --- drivers.c.orig 2003-11-21 19:27:51.000000000 -0600 +++ drivers.c 2008-02-13 12:25:14.000000000 -0600 @@ -593,7 +593,8 @@ int ifcount[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_SYSTEM, IFMIB_IFCOUNT }; - int count, size; + int count; + size_t size; size = sizeof(count); if (sysctl(ifcount, sizeof(ifcount) / sizeof(int), &count, &size, NULL, 0) < 0) { @@ -607,7 +608,7 @@ int ifinfo[] = { CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, index, IFDATA_GENERAL }; - int size = sizeof(*ifmd); + size_t size = sizeof(*ifmd); if (sysctl(ifinfo, sizeof(ifinfo) / sizeof(int), ifmd, &size, NULL, 0) < 0) return 0; >Release-Note: >Audit-Trail: >Unformatted: