Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 2004 17:13:17 +0200
From:      "Willem Jan Withagen" <wjw@withagen.nl>
To:        <freebsd-ports@freebsd.org>
Subject:   Running net-snmp on amd64
Message-ID:  <026a01c44fc6$9fe59a40$471b3dd4@dual>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?026a01c44fc6$9fe59a40$471b3dd4>