]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
If we're a relay, avoid picking ourselves as an introduction point,
authorRoger Dingledine <arma@torproject.org>
Mon, 4 Feb 2008 17:25:24 +0000 (17:25 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 4 Feb 2008 17:25:24 +0000 (17:25 +0000)
a rendezvous point, or as the final hop for internal circuits. Bug
reported by taranis and lodger. Bugfix on 0.1.2.x.

svn:r13372

ChangeLog
src/or/circuitbuild.c
src/or/routerlist.c

index 005834ff4ada0a259e3b34194d0e3c656be5af23..ec656b9c8eee346a4972fd82806b62a44e8dd6a7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
-Changes in version 0.2.0.19-alpha - 2008-0?-??
+Changes in version 0.2.0.19-alpha - 2008-02-??
+  o Major bugfixes:
+    - If we're a relay, avoid picking ourselves as an introduction point,
+      a rendezvous point, or as the final hop for internal circuits. Bug
+      reported by taranis and lodger. Bugfix on 0.1.2.x.
+
   o Minor bugfixes:
     - Directory caches now fetch certificates from all authorities
       listed in a networkstatus consensus, even when they do not
index 4f579221607e35850e75718566c89c3b88d735ad..785926b09b0f6e1e7d953825ad5ba43bdd736016 100644 (file)
@@ -1577,10 +1577,6 @@ choose_good_middle_server(uint8_t purpose,
     smartlist_add(excluded, r);
     routerlist_add_family(excluded, r);
   }
-  if ((r = routerlist_find_my_routerinfo())) {
-    smartlist_add(excluded, r);
-    routerlist_add_family(excluded, r);
-  }
   for (i = 0, cpath = head; i < cur_len; ++i, cpath=cpath->next) {
     if ((r = router_get_by_digest(cpath->extend_info->identity_digest))) {
       smartlist_add(excluded, r);
@@ -1624,10 +1620,6 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
     smartlist_add(excluded, r);
     routerlist_add_family(excluded, r);
   }
-  if ((r = routerlist_find_my_routerinfo())) {
-    smartlist_add(excluded, r);
-    routerlist_add_family(excluded, r);
-  }
   if (firewall_is_fascist_or()) {
     /* exclude all ORs that listen on the wrong port */
     routerlist_t *rl = router_get_routerlist();
index 5a347ae4f8e14f1af591f2a60bc8bbc0b9eeefd1..c0d2aaac5fac9e5b24df2c7c43a783a2bb3274bd 100644 (file)
@@ -1659,7 +1659,7 @@ router_choose_random_node(const char *preferred,
                           int weight_for_exit)
 {
   smartlist_t *sl, *excludednodes;
-  routerinfo_t *choice = NULL;
+  routerinfo_t *choice = NULL, *r;
   bandwidth_weight_rule_t rule;
 
   tor_assert(!(weight_for_exit && need_guard));
@@ -1669,6 +1669,11 @@ router_choose_random_node(const char *preferred,
   excludednodes = smartlist_create();
   add_nickname_list_to_smartlist(excludednodes,excluded,0);
 
+  if ((r = routerlist_find_my_routerinfo())) {
+    smartlist_add(excludednodes, r);
+    routerlist_add_family(excludednodes, r);
+  }
+
   /* Try the preferred nodes first. Ignore need_uptime and need_capacity
    * and need_guard, since the user explicitly asked for these nodes. */
   if (preferred) {