Date: Mon, 25 Jul 2011 04:50:05 GMT From: "Alexander V. Chernikov" <melifaro@ipfw.ru> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/159099: [ioctl] ioctl SIOCGIFCONF reports interface names which are blank Message-ID: <201107250450.p6P4o59f061211@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/159099; it has been noted by GNATS. From: "Alexander V. Chernikov" <melifaro@ipfw.ru> To: bug-followup@FreeBSD.org, sreeramabs@netapp.com Cc: Subject: Re: kern/159099: [ioctl] ioctl SIOCGIFCONF reports interface names which are blank Date: Mon, 25 Jul 2011 08:38:12 +0400 Data returned by SIOCGIFCONF is correct. It just has to be read another way. General struct sockaddr was planned to be enough for holding AF_INET/AF_INET6 address. It is not enough large to hold AF_LINK address (sockaddr_dl), for example. There is also traditional 4.3BSD socket interface with sa_len field contained within struct sockaddr. *BSD, AIX, Darwin, QNX are using it. Linux, Solaris, Cygwin does not. This really leads to portability problems for many people. On all systems supporting sa_len real ifreq length is calculated using sa_len field. sa_len support should be checked before compilation (usually done by autoconf) Please see /usr/src/contrib/traceroute/ifaddrlist.c for example of doing this really portable way.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107250450.p6P4o59f061211>