[tor-commits] [tor/master] Vote Exit correctly with DirAllowPrivateAddresses set

nickm at torproject.org nickm at torproject.org
Wed Sep 7 15:38:50 UTC 2016


commit 0d485fcfeff530a1f299d84195d1c35b8f313856
Author: Sebastian Hahn <sebastian at torproject.org>
Date:   Mon Sep 5 23:32:16 2016 +0200

    Vote Exit correctly with DirAllowPrivateAddresses set
    
    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  | 5 +++++
 src/or/policies.c | 4 +++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/changes/bug20064 b/changes/bug20064
new file mode 100644
index 0000000..38d3b91
--- /dev/null
+++ b/changes/bug20064
@@ -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.
+
diff --git a/src/or/policies.c b/src/or/policies.c
index 07f256f..44a46d2 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -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. */





More information about the tor-commits mailing list