Date: Wed, 12 Aug 2009 18:53:30 GMT From: Larry Baird <lab@gta.com> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/137700: NET_RT_DUMP not working in FreeBSD 8 Message-ID: <200908121853.n7CIrUHH049842@www.freebsd.org> Resent-Message-ID: <200908121900.n7CJ0GAL097051@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 137700
>Category: misc
>Synopsis: NET_RT_DUMP not working in FreeBSD 8
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 12 19:00:15 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Larry Baird
>Release: 8.0
>Organization:
GTA, Inc.
>Environment:
FreeBSD griffin.gta.com 8.0-BETA2 FreeBSD 8.0-BETA2 #0: Mon Aug 3 12:50:53 EDT 2009 root@griffin.gta.com:/usr/src/sys/i386/compile/GRIFFIN i386
>Description:
Sysctl for getting routing table always returns 0 for size.
>How-To-Repeat:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
int main( int argc, char *argv[] )
{
int mib[6];
size_t needed;
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
mib[2] = 0; /* protocol */
mib[3] = 0; /* wildcard address family */
mib[4] = NET_RT_DUMP;
mib[5] = 0; /* no flags */
if ( sysctl( mib, 6, NULL, &needed, NULL, 0 ) < 0 ) {
perror( "sysctl" );
} else {
printf( "Buffer needs %d bytes\n", needed );
}
exit( 0 );
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908121853.n7CIrUHH049842>
