Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Feb 2008 12:40:03 -0600 (CST)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        Hugo Silva <hugo@barafranca.com>
Cc:        freebsd-stable@FreeBSD.org
Subject:   Re: AMD64 vs i386, ifstat and bsnmp
Message-ID:  <alpine.BSF.1.00.0802131226270.9796@thor.farley.org>
In-Reply-To: <47B334CD.1000200@barafranca.com>
References:  <200802131453.m1DErqO8071630@lava.sentex.ca> <47B334CD.1000200@barafranca.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, 13 Feb 2008, Hugo Silva wrote:

> Mike Tancsa wrote:
>> Couple of little things I noticed with a new RELENG_7 AMD64 box (as of 
>> yesterday)
>> 
>> ifstat from the ports cannot seem to find interfaces for some reason ?  It 
>> works fine on i386

*snip*

Try this patch.  The type to the fourth argument to sysctl is wrong
(int) and should be size_t.

Sean
-- 
scf@FreeBSD.org
[-- Attachment #2 --]
--- 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;
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.1.00.0802131226270.9796>