[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r13372: If we're a relay, avoid picking ourselves as an introduction (in tor/trunk: . src/or)
Author: arma
Date: 2008-02-04 12:25:24 -0500 (Mon, 04 Feb 2008)
New Revision: 13372
Modified:
tor/trunk/ChangeLog
tor/trunk/src/or/circuitbuild.c
tor/trunk/src/or/routerlist.c
Log:
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.
Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog 2008-02-04 16:58:50 UTC (rev 13371)
+++ tor/trunk/ChangeLog 2008-02-04 17:25:24 UTC (rev 13372)
@@ -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
Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c 2008-02-04 16:58:50 UTC (rev 13371)
+++ tor/trunk/src/or/circuitbuild.c 2008-02-04 17:25:24 UTC (rev 13372)
@@ -1577,10 +1577,6 @@
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 @@
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();
Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c 2008-02-04 16:58:50 UTC (rev 13371)
+++ tor/trunk/src/or/routerlist.c 2008-02-04 17:25:24 UTC (rev 13372)
@@ -1659,7 +1659,7 @@
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 @@
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) {