From: Nick Mathewson Date: Mon, 1 Feb 2016 14:41:45 +0000 (-0500) Subject: Merge branch 'maint-0.2.7' X-Git-Tag: tor-0.2.8.1-alpha~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd93a6a59236519dee2a1a7ee824904e923189d;p=thirdparty%2Ftor.git Merge branch 'maint-0.2.7' (We already had a fix for the address test freebsd issues) --- 4cd93a6a59236519dee2a1a7ee824904e923189d diff --cc src/test/test_address.c index 3ddf2476e3,4cf3a5a3a6..3b17b23571 --- a/src/test/test_address.c +++ b/src/test/test_address.c @@@ -511,28 -481,16 +511,28 @@@ test_address_get_if_addrs_ioctl(void *a (void)arg; - result = get_interface_addresses_ioctl(LOG_ERR); + result = get_interface_addresses_ioctl(LOG_ERR, AF_INET); + /* On an IPv6-only system, this will fail and return NULL tt_assert(result); - tt_int_op(smartlist_len(result),>=,1); + */ -#ifndef __FreeBSD__ - /* FreeBSD doesn't have a localhost in jails sometimes. */ - tt_assert(smartlist_contains_localhost_tor_addr(result)); -#endif - done: + /* Some FreeBSD jails don't have localhost IP address. Instead, they only + * have the address assigned to the jail (whatever that may be). + * And a jail without a network connection might not have any addresses at + * all. */ + if (result) { + tt_assert(!smartlist_contains_null_tor_addr(result)); + + /* If there are addresses, they must be IPv4 or IPv6. + * (AIX supports IPv6 from SIOCGIFCONF.) */ + if (smartlist_len(result) > 0) { + tt_assert(smartlist_contains_ipv4_tor_addr(result) + || smartlist_contains_ipv6_tor_addr(result)); + } + } + - done: ++ done: if (result) { SMARTLIST_FOREACH(result, tor_addr_t *, t, tor_free(t)); smartlist_free(result);