]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Vote Exit correctly with DirAllowPrivateAddresses set
authorSebastian Hahn <sebastian@torproject.org>
Mon, 5 Sep 2016 21:32:16 +0000 (23:32 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Mon, 5 Sep 2016 21:39:47 +0000 (23:39 +0200)
When allowing private addresses, mark Exits that only exit to private
locations as such. Fixes bug 20064; bugfix on 0.2.2.9-alpha.

changes/bug20064 [new file with mode: 0644]
src/or/policies.c

diff --git a/changes/bug20064 b/changes/bug20064
new file mode 100644 (file)
index 0000000..38d3b91
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (Directory Authority):
+   - When allowing private addresses, mark Exits that only exit to
+     private locations as such. Fixes bug 20064; bugfix on
+     0.2.2.9-alpha.
+
index 07f256f5cc108045d3b8d7f422ed40661130a26c..44a46d2fe20feb77fc48ac01859828bf6e634a27 100644 (file)
@@ -2119,8 +2119,10 @@ exit_policy_is_general_exit_helper(smartlist_t *policy, int port)
       if (subnet_status[i] != 0)
         continue; /* We already reject some part of this /8 */
       tor_addr_from_ipv4h(&addr, i<<24);
-      if (tor_addr_is_internal(&addr, 0))
+      if (tor_addr_is_internal(&addr, 0) &&
+          !get_options()->DirAllowPrivateAddresses) {
         continue; /* Local or non-routable addresses */
+      }
       if (p->policy_type == ADDR_POLICY_ACCEPT) {
         if (p->maskbits > 8)
           continue; /* Narrower than a /8. */