getifaddrs(3), ifa_data field

Benjamin Lutz mail at maxlor.com
Fri Jan 15 09:43:51 UTC 2010


I noticed that the getifaddrs(3) library function doesn't behave as 
described in the manpage. The manpage says:

   The ifa_data field references address family specific data.  For AF_LINK
   addresses it contains a pointer to the struct if_data (as defined in
   include file <net/if.h>) which contains various interface attributes and
   statistics.

This is correct and works.

   For all other address families, it contains a pointer to the
   struct ifa_data (as defined in include file <net/if.h>) which contains
   per‐address interface statistics.

This is not what I'm seeing. First, I can't find a struct ifa_data 
definition, and second, the ifa_data field seems to be NULL for all address 
types other than AF_LINK.

I'm thinking there are three possible explanations for this behaviour:

- I need to set some non-default option to enable the ifa_data field for
  non-AF_LINK addresses.

- There's a regression; the ifa_data field should contain data for
  non-AF_LINK addresses but no longer does.

- The behaviour is correct, but the manpageis outdated.

Please give me a bit more background information on this issue.

Cheers
Benjamin


More information about the freebsd-hackers mailing list