]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
When examining interfaces to find an address, discard non-up ones.
authorNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2013 20:46:29 +0000 (16:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 8 Oct 2013 20:46:29 +0000 (16:46 -0400)
Patch from "hantwister" on trac. Fixes bug #9904; bugfix on
0.2.3.11-alpha.

changes/bug9904 [new file with mode: 0644]
src/common/address.c

diff --git a/changes/bug9904 b/changes/bug9904
new file mode 100644 (file)
index 0000000..eec4144
--- /dev/null
@@ -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".
index 227b4fbaee096838fdc7a891d242b667f4d2d021..14a7b6bc96ad7124a266b6f74d585fc3a4821838 100644 (file)
@@ -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 &&