]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
actually, don't fix it that far. we should still do some
authorRoger Dingledine <arma@torproject.org>
Fri, 9 Jun 2006 09:07:59 +0000 (09:07 +0000)
committerRoger Dingledine <arma@torproject.org>
Fri, 9 Jun 2006 09:07:59 +0000 (09:07 +0000)
error checking.

svn:r6576

src/or/circuitbuild.c

index 4fc56c2ca3e7cca094387a2a9db023d4261067e7..0e08b03b499cf55f406c95bd95db33ae7ba1990f 100644 (file)
@@ -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));