[or-cvs] r8581: the other half of the is_local_IP patch (tor/trunk/src/or)

arma at seul.org arma at seul.org
Tue Oct 3 05:45:58 UTC 2006


Author: arma
Date: 2006-10-03 01:45:58 -0400 (Tue, 03 Oct 2006)
New Revision: 8581

Modified:
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/config.c
Log:
the other half of the is_local_IP patch


Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2006-10-02 22:13:42 UTC (rev 8580)
+++ tor/trunk/src/or/circuitbuild.c	2006-10-03 05:45:58 UTC (rev 8581)
@@ -1443,6 +1443,7 @@
         ((tor_version_as_new_as(r->platform,"0.1.1.21-cvs") &&
           !tor_version_as_new_as(r->platform,"0.1.2.0-alpha-cvs")) ||
          tor_version_as_new_as(r->platform,"0.1.2.1-alpha")) &&
+        !is_local_IP(r->addr) &&
         !router_get_trusteddirserver_by_digest(r->cache_info.identity_digest))
       smartlist_add(choices, r));
   router = smartlist_choose(choices);

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2006-10-02 22:13:42 UTC (rev 8580)
+++ tor/trunk/src/or/config.c	2006-10-03 05:45:58 UTC (rev 8581)
@@ -1729,9 +1729,10 @@
 {
   if (is_internal_IP(ip, 0))
     return 1;
-  /* Check whether ip is on the same /24 as we are.
-   *
-   * It's possible that this next check will hit before the first time
+  /* Check whether ip is on the same /24 as we are. */
+  if (get_options()->EnforceDistinctSubnets == 0)
+    return 0;
+  /* It's possible that this next check will hit before the first time
    * resolve_my_address actually succeeds.  (For clients, it is likely that
    * resolve_my_address will never be called at all).  In those cases,
    * last_resolved_addr will be 0, and so checking to see whether ip is on the



More information about the tor-commits mailing list