reimplement if_nameindex and getifaddrs using netlink
authorTimo Teräs <timo.teras@iki.fi>
Tue, 8 Apr 2014 14:03:16 +0000 (14:03 +0000)
committerRich Felker <dalias@aerifal.cx>
Wed, 30 Jul 2014 00:57:31 +0000 (20:57 -0400)
commit08e4052c43692a9306c5c638d70fba7f7ba08c52
treec6163802d24ed751bb5942ff862e17217083807b
parentcbb609b3db500e6aebe15762abebc4cb23563b8a
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.
src/network/getifaddrs.c
src/network/if_nameindex.c
src/network/netlink.c [new file with mode: 0644]
src/network/netlink.h [new file with mode: 0644]