agent: Use getnameinfo() instead of inet_ntop() to stringify addresses
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Fri, 4 Jul 2014 10:41:52 +0000 (11:41 +0100)
committerOlivier Crête <olivier.crete@collabora.com>
Mon, 7 Jul 2014 23:39:22 +0000 (19:39 -0400)
commit9a622300e88f7c439773fc385c98051796ac67cf
treed29c5a2564b5aa205e090369c6fc074e8bbc8f32
parent4645686f0ce1eedb60b40cccee8cbaff91624387
agent: Use getnameinfo() instead of inet_ntop() to stringify addresses

inet_ntop() drops IPv6 link-local scope IDs on the floor, which means
libnice doesn’t generate any IPv6 candidates for link-local connections,
meaning that it will theoretically fail to negotiate a connection on an
IPv6-only network where the two peers are local.

Fix that by using getnameinfo() to convert sockaddrs to strings, which
preserves the scope ID.

There are no portability concerns — getnameinfo() is POSIX.1-2001, and
isn’t used on Windows (although it is supported, surprisingly).
agent/interfaces.c