[tor-commits] [tor/release-0.2.4] When examining interfaces to find an address, discard non-up ones.

arma at torproject.org arma at torproject.org
Fri Oct 11 01:43:31 UTC 2013


commit b8abadedd3cb7ac3d140becf23d0a624e6405749
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Oct 8 16:46:29 2013 -0400

    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.
---
 changes/bug9904      |    4 ++++
 src/common/address.c |    2 ++
 2 files changed, 6 insertions(+)

diff --git a/changes/bug9904 b/changes/bug9904
new file mode 100644
index 0000000..eec4144
--- /dev/null
+++ b/changes/bug9904
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - When examining list of network interfaces to find our address, do
+      not consider non-running or disabled network interfaces. Fixes bug
+      9904; bugfix on 0.2.3.11-alpha. Patch from "hantwister".
diff --git a/src/common/address.c b/src/common/address.c
index 227b4fb..14a7b6b 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 &&





More information about the tor-commits mailing list