[Bug 159099] [ioctl] ioctl SIOCGIFCONF does not export an array of struct ifreq

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Mar 29 22:51:20 UTC 2018


Brooks Davis <brooks at FreeBSD.org> changed:

           What    |Removed                     |Added
          Component|kern                        |Documentation
            Summary|[ioctl] ioctl SIOCGIFCONF   |[ioctl] ioctl SIOCGIFCONF
                   |reports interface names     |does not export an array of
                   |which are blank             |struct ifreq
           Assignee|freebsd-bugs at FreeBSD.org    |freebsd-doc at FreeBSD.org
                 CC|                            |brooks at FreeBSD.org
            Product|Base System                 |Documentation
            Version|unspecified                 |Latest

--- Comment #4 from Brooks Davis <brooks at FreeBSD.org> ---
The documented behavior of SIOCGIFCONF is to write an array of struct ifreq. 
If all interface addresses (including link layer addresses) fit in struct
sockaddr's 14 bytes of sa_data this is true.  If any longer addresses exist
(e.g. IPv6 addresses) then the implementation writes out the ifr_name value
(16-bytes) followed by the sockaddr.  The next item follows the same rule.

Both the current implementation and tcpdump assume that there is no pad between
ifr_name and ifr_addr.  This assumption holds for all current architectures.

[I believe this is a documentation bug in both the comments and the manpages. 
Documentation should note the above issues and this this interface is

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-doc mailing list