Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Jan 2010 10:24:26 +0100
From:      Benjamin Lutz <mail@maxlor.com>
To:        freebsd-hackers@freebsd.org
Subject:   getifaddrs(3), ifa_data field
Message-ID:  <201001151024.26325.mail@maxlor.com>

next in thread | raw e-mail | index | archive | help
I noticed that the getifaddrs(3) library function doesn't behave as=20
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=E2=80=90address interface statistics.

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

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

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

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

=2D The behaviour is correct, but the manpageis outdated.

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

Cheers
Benjamin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001151024.26325.mail>