History log of /seL4-refos-master/libs/libmuslc/src/network/getifaddrs.c
Revision Date Author Comments
# 7b712844 19-Nov-2015 Jo-Philipp Wich <jow@openwrt.org>

properly handle point-to-point interfaces in getifaddrs()

With point-to-point interfaces, the IFA_ADDRESS netlink attribute
contains the peer address while an extra attribute IFA_LOCAL carries
the actual local interface address.

Both the glibc and uclibc implementations of getifaddrs() handle this
case by moving the ifa_addr contents to the broadcast/remote address
union and overwriting ifa_addr upon receipt of an IFA_LOCAL attribute.

This patch adds the same special treatment logic of IFA_LOCAL to
musl's implementation of getifaddrs() in order to align its behaviour
with that of uclibc and glibc.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>


# 08e4052c 08-Apr-2014 Timo Teräs <timo.teras@iki.fi>

reimplement if_nameindex and getifaddrs using netlink

the previous implementations had several deficiencies, the most severe
of which was the inability to report unconfigured interfaces or
interfaces without ipv4 addresses. among the options discussed for
fixing this, using netlink turned out to be the one with the least
cost and most additional advantages. other improvements include:

if_nameindex now avoids duplicates in the list it produces, but still
includes legacy-style interface aliases if any are in use.

getifaddrs now reports hardware addresses and includes the scope_id
for link-local ipv6 addresses in the resulting address.


# 57174444 11-Dec-2013 Szabolcs Nagy <nsz@port70.net>

include cleanups: remove unused headers and add feature test macros


# ceb0ed9c 20-Nov-2013 Rich Felker <dalias@aerifal.cx>

fix fd leak (missing close-on-exec) in getifaddrs


# 0716b10a 08-Jul-2013 Rich Felker <dalias@aerifal.cx>

fix missing SOCK_CLOEXEC in various functions that use sockets internally


# 9947ed5c 09-Apr-2013 rofl0r <retnyg@gmx.net>

getifaddrs: implement proper ipv6 netmasks


# 338cc31c 05-Apr-2013 rofl0r <retnyg@gmx.net>

getifaddrs: remove unused label


# 4af3ea78 05-Apr-2013 rofl0r <retnyg@gmx.net>

getifaddrs: use if_nameindex to enumerate interfaces


# 69a19838 05-Apr-2013 rofl0r <retnyg@gmx.net>

getifaddrs: one less indent level


# c82f53f6 05-Apr-2013 rofl0r <retnyg@gmx.net>

getifaddrs: less malloc


# 202db37a 05-Apr-2013 rofl0r <retnyg@gmx.net>

add getifaddrs

supports ipv4 and ipv6, but not the "extended" usage where
usage statistics and other info are assigned to ifa_data members
of duplicate entries with AF_PACKET family.