You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are two variants of struct ifaddrs in libc: one matching Linux with an ifa_ifu field and an OS X variant with only ifa_dstaddr. However, some other BSD derivates define ifa_broadaddr as well, which isn't currently covered (and I guess the fields would be misaligned on systems having ifa_broadaddr as a separate field in the struct).
Googling for getifaddr man pages, I found these different definitions:
Based on these findings, I suppose struct ifaddr in src/unix/bsd/mod.rs would have to move down to the variant-specific fiels under apple, freebsdlike and netbsdlike to adjust for this difference. And the Solaris variant should probably simply be changed to use ifa_ifu. Any other platform that needs to be supported and checked?
Actually, things aren't as bad as @mwanner thinks. The man pages make it look like the BSDs have an extra ifa_broadaddr field, but it's actually a macro for ifa_dstaddr. AFAICT, the only problem is on NetBSD, which adds an extra ifa_addrflags field at the end.
seem to be missing from ./unix/nonbsd/mod.rs, which would mean that all linux (not just android) builds of libc would just not have access to libc::ifaddrs?
To further complicate things, if this repo is to be believed, it seems that the Android NDK might not support ifaddrs.
The NetBSD situation with ifa_addrflags is complicated. The still-supported NetBSD 7.x release series does not have the ifa_addrflags field, while the NetBSD 8.x release series and -current do.
I've not looked closely as to what this particular difference means for compatibility of binaries. The lack of OS-level ABI/API breaking-change handling in the libc crate leaves a lot to be desired…
Activity
alexcrichton commentedon Jul 20, 2017
Platforms like Solaris and some BSD platforms aren't verified automatically today, so feel free to change the definition on those paltforms!
marmistrz commentedon Jul 23, 2017
Can Travis test BSD/Solaris?
alexcrichton commentedon Jul 23, 2017
Only with QEMU currently, they don't offer native hosts running BSD/Solaris
asomers commentedon Jul 26, 2017
I have a buildbot that I use to test nix and mio-aio on freebsd. What does it take to verify libc? I have plenty of cpu cycles to spare.
alexcrichton commentedon Jul 26, 2017
Oh note that we've already got QEMU emulation of FreeBSD, is that sufficient for libc?
asomers commentedon Jul 26, 2017
Yeah, QEMU is probably good enough for libc, as long as its fast enough.
asomers commentedon Nov 16, 2017
Actually, things aren't as bad as @mwanner thinks. The man pages make it look like the BSDs have an extra
ifa_broadaddrfield, but it's actually a macro forifa_dstaddr. AFAICT, the only problem is on NetBSD, which adds an extraifa_addrflagsfield at the end.Here are links to the structure definitions, as opposed to man pages
https://github.com/illumos/illumos-gate/blob/master/usr/src/head/ifaddrs.h
https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/include/ifaddrs.h?rev=1.4&content-type=text/x-cvsweb-markup
http://cvsweb.netbsd.org/bsdweb.cgi/src/include/ifaddrs.h?rev=1.8&content-type=text/x-cvsweb-markup&only_with_tag=MAIN
https://svnweb.freebsd.org/base/head/include/ifaddrs.h?revision=250887&view=markup
A maintainer should retitle the issue to "missing field for struct ifaddrs on NetBSD"
EternalDeiwos commentedon Jan 13, 2018
Registering an interest regarding this for Android.
I've noticed that this seems to be absent from the linux path? Specifically the following in
./unix/bsd/mod.rs:seem to be missing from
./unix/nonbsd/mod.rs, which would mean that all linux (not just android) builds oflibcwould just not have access tolibc::ifaddrs?To further complicate things, if this repo is to be believed, it seems that the Android NDK might not support
ifaddrs.jakllsch commentedon Aug 14, 2018
The NetBSD situation with ifa_addrflags is complicated. The still-supported NetBSD 7.x release series does not have the ifa_addrflags field, while the NetBSD 8.x release series and -current do.
I've not looked closely as to what this particular difference means for compatibility of binaries. The lack of OS-level ABI/API breaking-change handling in the libc crate leaves a lot to be desired…
gnzlbg commentedon Nov 22, 2018
It seems that a lot of work has happened here already. What exactly remains to be done here?
mwanner commentedon Nov 23, 2018
I agree,
ifa_broadaddrhas vanished, it seems.Improve support for niche platforms