Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libc: use musl implementation of getifaddrs and if_nameindex
This patch replaces our home grown (possibly old musl version based) implementation of getifaddrs() and if_nameindex() with the implemantation of those provided by modern version musl 1.1.24 that uses netlink interface. The advantage is that it will also support IPV6 once we merge the ipv6 branch. Please note that we are applying simple header trick with __netlink.h to counter a bug in musl netlink.c. In essence the __netlink_enumerate() in musl netlink.c calls recv() with MSG_DONTWAIT flag may (and it does sometimes on OSv) yield EAGAIN or EWOULDBLOCK errors and there is no error handling logic of those. Instead of adding the error handling we change recv call to use 0 flags by re-defining MSG_DONTWAIT as 0 to enforce blocking call which is for example what Golang runtime does to implement similar functionality. Eventually we should try to upstream a patch to musl. Signed-off-by: Waldemar Kozaczuk <[email protected]>
- Loading branch information