Running net-snmp on amd64

Willem Jan Withagen wjw at withagen.nl
Fri Jun 11 15:18:38 GMT 2004


Hi,

I't trying to get net-snmp running on my system, but snmpd crashes in this
snippet of code:
mibII/ipv6.c

        const char     *tcblist = "net.inet.tcp.pcblist";
        int             len;

        if (sysctlbyname(tcblist, 0, &len, 0, 0) < 0)
            return NULL;
        if ((sysctl_buf = malloc(len)) == NULL)
            return NULL;
        if (sysctlbyname(tcblist, sysctl_buf, &len, 0, 0) < 0) {
            free(sysctl_buf);
            return NULL;
        }

The definition in sys/sysctl.h is:
int     sysctlbyname(const char *, void *, size_t *, void *, size_t);

So how is it possible that after the return on the first sysctlbyname call
tcblist contains 0x200000000, instead of the text pointer....

Compiled with:
cc -I../../include -I../../include -I. -I../.. -I. -I./../.. -I./../../snmplib -
I./.. -I.. -DAPPLLIB_EXP=/usr/local/lib/perl5/5.8.2/BSDPAN -DHAS_FPSETMASK -DHAS
_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include -I/usr/local/lib/perl
5/5.8.2/mach/CORE -DINET6 -pipe -g -Dfreebsd5 -c mibII/ipv6.c  -fPIC -DPIC -o
mibII/.libs/ipv6.lo

Is this a compiler error, or need I look elsewhere??

Thanx,
--WjW



More information about the freebsd-ports mailing list