aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-08 16:46:29 -0400
committerNick Mathewson <nickm@torproject.org>2013-10-08 16:46:29 -0400
commitb8abadedd3cb7ac3d140becf23d0a624e6405749 (patch)
tree9ef889c1201094d94f48c686f97bf08745659bc8 /src/common
parentfa1034cd999f19a50e6183dac6c65b3acaefe856 (diff)
downloadtor-b8abadedd3cb7ac3d140becf23d0a624e6405749.tar
tor-b8abadedd3cb7ac3d140becf23d0a624e6405749.tar.gz
When examining interfaces to find an address, discard non-up ones.
Patch from "hantwister" on trac. Fixes bug #9904; bugfix on 0.2.3.11-alpha.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/address.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/address.c b/src/common/address.c
index 227b4fbae..14a7b6bc9 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -1187,6 +1187,8 @@ get_interface_addresses_raw(int severity)
result = smartlist_new();
for (i = ifa; i; i = i->ifa_next) {
tor_addr_t tmp;
+ if ((i->ifa_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING))
+ continue;
if (!i->ifa_addr)
continue;
if (i->ifa_addr->sa_family != AF_INET &&