misc/137700: NET_RT_DUMP not working in FreeBSD 8

Larry Baird lab at gta.com
Wed Aug 12 19:00:17 UTC 2009


>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 at 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:


More information about the freebsd-bugs mailing list