Problem with IFDATA_DRIVERNAME sysctl

Bruce M Simpson bms at incunabulum.net
Tue Sep 9 23:50:54 UTC 2008


Whenever I call this sysctl, I get an errno of EPROGNOTAVAIL from sysctl():

»·······name[0] = CTL_NET;
»·······name[1] = PF_LINK;
»·······name[2] = NETLINK_GENERIC;
»·······name[3] = IFMIB_IFDATA;
»·······name[4] = ifindex;
»·······name[5] = IFDATA_DRIVERNAME;

»·······len = IFNAMSIZ;
»·······if (sysctl(name, 6, dname, &len, NULL, 0) == -1) {
»·······»·······warnc(EX_OSERR, "cannot obtain driver name for ifname %s",
»·······»·······    ifname);
»·······»·······return (-1);
»·······}

The ifindex is valid. "dname" is a pointer to an IFNAMSIZ sized buffer. 
This problem is happening on a 7.0-RELEASE system.

It looks like the switch..case in that path could be fubar'd by the 
compiler as there are not break statements for each distinct case label, 
could this be due to gcc friendly fire?

cheers
BMS




More information about the freebsd-net mailing list