[or-cvs] r12514: If we're using bridges or have strictentrynodes set, and our (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Fri Nov 16 07:37:50 UTC 2007


Author: arma
Date: 2007-11-16 02:37:49 -0500 (Fri, 16 Nov 2007)
New Revision: 12514

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuitbuild.c
Log:
If we're using bridges or have strictentrynodes set, and our
chosen exit is in the same family as all our bridges/entry guards,
then be flexible about families.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-11-16 07:33:57 UTC (rev 12513)
+++ tor/trunk/ChangeLog	2007-11-16 07:37:49 UTC (rev 12514)
@@ -16,6 +16,9 @@
       the bridge authority could help us (for example, we don't know
       a digest, or there is no bridge authority), don't be so eager to
       fall back to asking the bridge authority.
+    - If we're using bridges or have strictentrynodes set, and our
+      chosen exit is in the same family as all our bridges/entry guards,
+      then be flexible about families.
 
   o Minor features:
     - When we negotiate a v2 OR connection (not yet implemented), accept

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2007-11-16 07:33:57 UTC (rev 12513)
+++ tor/trunk/src/or/circuitbuild.c	2007-11-16 07:37:49 UTC (rev 12514)
@@ -2443,10 +2443,12 @@
   routerinfo_t *r = NULL;
   int need_uptime = state ? state->need_uptime : 0;
   int need_capacity = state ? state->need_capacity : 0;
+  int consider_exit_family = 0;
 
   if (chosen_exit) {
     smartlist_add(exit_family, chosen_exit);
     routerlist_add_family(exit_family, chosen_exit);
+    consider_exit_family = 1;
   }
 
   if (!entry_guards)
@@ -2465,7 +2467,7 @@
   SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
     {
       r = entry_is_live(entry, need_uptime, need_capacity, 0);
-      if (r && !smartlist_isin(exit_family, r)) {
+      if (r && (!consider_exit_family || !smartlist_isin(exit_family, r))) {
         smartlist_add(live_entry_guards, r);
         if (!entry->made_contact) {
           /* Always start with the first not-yet-contacted entry
@@ -2504,6 +2506,13 @@
       need_capacity = 0;
       goto retry;
     }
+    if (!r && !can_grow_entry_list(options) && consider_exit_family) {
+      /* still no? if we're using bridges or have strictentrynodes
+       * set, and our chosen exit is in the same family as all our
+       * bridges/entry guards, then be flexible about families. */
+      consider_exit_family = 0;
+      goto retry;
+    }
     /* live_entry_guards may be empty below. Oh well, we tried. */
   }
 



More information about the tor-commits mailing list