summaryrefslogtreecommitdiff
path: root/src/common/address.c
diff options
context:
space:
mode:
authorcypherpunks <cypherpunks@localhost>2016-09-30 21:49:09 +0000
committerNick Mathewson <nickm@torproject.org>2016-10-03 13:50:27 -0400
commit3b2f012e28f73267a894c5e3b468c65d8e093b15 (patch)
tree4afdcf2b35ebeabbb7a6fcdb8e06313e8e3a8e41 /src/common/address.c
parentae4077916c94e9c15fa2800f51409ccb116bf63f (diff)
downloadtor-3b2f012e28f73267a894c5e3b468c65d8e093b15.tar.gz
tor-3b2f012e28f73267a894c5e3b468c65d8e093b15.zip
Avoid reordering IPv6 interface addresses
When deleting unsuitable addresses in get_interface_address6_list(), to avoid reordering IPv6 interface addresses and keep the order returned by the OS, use SMARTLIST_DEL_CURRENT_KEEPORDER() instead of SMARTLIST_DEL_CURRENT(). This issue was reported by René Mayrhofer. [Closes ticket 20163; changes file written by teor. This paragraph added by nickm]
Diffstat (limited to 'src/common/address.c')
-rw-r--r--src/common/address.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 6799dd6c56..15ee3dbd17 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1770,13 +1770,13 @@ MOCK_IMPL(smartlist_t *,get_interface_address6_list,(int severity,
{
if (tor_addr_is_loopback(a) ||
tor_addr_is_multicast(a)) {
- SMARTLIST_DEL_CURRENT(addrs, a);
+ SMARTLIST_DEL_CURRENT_KEEPORDER(addrs, a);
tor_free(a);
continue;
}
if (!include_internal && tor_addr_is_internal(a, 0)) {
- SMARTLIST_DEL_CURRENT(addrs, a);
+ SMARTLIST_DEL_CURRENT_KEEPORDER(addrs, a);
tor_free(a);
continue;
}