properly handle point-to-point interfaces in getifaddrs()
commit7b712844e38bdfc1ef728e257fb8616c16ec4cc8
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 19 Nov 2015 20:43:10 +0000 (19 21:43 +0100)
committerRich Felker <dalias@aerifal.cx>
Mon, 30 Nov 2015 19:57:25 +0000 (30 14:57 -0500)
treed115500c8b1bf378476b46867c1a5b6b5f3e320b
parent12978acb3066db738c8c15121e81adbb63739876
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>
src/network/getifaddrs.c