]> git.ozlabs.org Git - ccan/commit
net: fix tests on hosts where 'localhost' is v4 _and_ v6
authorSam Vilain <sam@vilain.net>
Tue, 22 Feb 2011 04:56:36 +0000 (15:26 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Feb 2011 04:56:36 +0000 (15:26 +1030)
commitc95e517b59710347e99e07f6e73a6aeee46adb9a
treedb9cdc005e701083e90a47f2655d156ff8ec15ae
parent6a6f64f541e5d09162e0ba8814e04feb13ff5e8f
net: fix tests on hosts where 'localhost' is v4 _and_ v6
If 'localhost' exists in /etc/hosts with a v4 and a v6 address, the hack
which joins two addrinfo entries together is not necessary.  Detect to see
if 'localhost' returned a v6 address, and if so, just return the single
linked list result from getaddrinfo()

(Reworked by Rusty Russell)
Signed-off-by: Sam Vilain <sam@vilain.net>
ccan/net/test/run.c