[or-cvs] actually, don"t fix it that far. we should still do some

arma at seul.org arma at seul.org
Fri Jun 9 09:08:01 UTC 2006


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	circuitbuild.c 
Log Message:
actually, don't fix it that far. we should still do some
error checking.


Index: circuitbuild.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.241
retrieving revision 1.242
diff -u -p -d -r1.241 -r1.242
--- circuitbuild.c	9 Jun 2006 09:02:32 -0000	1.241
+++ circuitbuild.c	9 Jun 2006 09:07:59 -0000	1.242
@@ -1817,12 +1817,15 @@ add_an_entry_guard(routerinfo_t *chosen)
   routerinfo_t *router;
   entry_guard_t *entry;
 
-  if (chosen)
+  if (chosen) {
     router = chosen;
-  else
+    if (is_an_entry_guard(router->cache_info.identity_digest))
+      return NULL;
+  } else {
     router = choose_good_entry_server(CIRCUIT_PURPOSE_C_GENERAL, NULL);
-  if (!router)
-    return NULL;
+    if (!router)
+      return NULL;
+  }
   entry = tor_malloc_zero(sizeof(entry_guard_t));
   log_info(LD_CIRC, "Chose '%s' as new entry guard.", router->nickname);
   strlcpy(entry->nickname, router->nickname, sizeof(entry->nickname));



More information about the tor-commits mailing list