summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2008-09-24 22:29:22 +0000
committerKarsten Loesing <karsten.loesing@gmx.net>2008-09-24 22:29:22 +0000
commit9a7098487b2c25f36112b3521758f42621dcd6af (patch)
tree60dfda30dfd226d091c1d510fe65fd0d1cbc5f28
parent7f805aca2b39f38ab13bbd7dfbebff5c24fbb350 (diff)
downloadtor-9a7098487b2c25f36112b3521758f42621dcd6af.tar.gz
tor-9a7098487b2c25f36112b3521758f42621dcd6af.zip
If we are not using BEGIN_DIR cells, don't attempt to contact hidden service directories with non-open dir port.
svn:r16960
-rw-r--r--ChangeLog2
-rw-r--r--src/or/routerlist.c10
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e2fe6e408e..fa93ef1b75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -56,6 +56,8 @@ Changes in version 0.2.1.6-alpha - 2008-09-xx
port 80, we would previously reject the connection. Now, we assume
the user knows what they were asking for. Fixes bug 752. Bugfix
on 0.0.9rc5. Diagnosed by BarkerJr.
+ - If we are not using BEGIN_DIR cells, don't attempt to contact hidden
+ service directories with non-open dir port. Bugfix on 0.2.0.10-alpha.
o Minor features:
- Update to the "September 1 2008" ip-to-country file.
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 66ca2bf479..52abe85fc6 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -4918,6 +4918,7 @@ hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
{
int start, found, n_added = 0, i;
networkstatus_t *c = networkstatus_get_latest_consensus();
+ int use_begindir = get_options()->TunnelDirConns;
if (!c || !smartlist_len(c->routerstatus_list)) {
log_warn(LD_REND, "We don't have a consensus, so we can't perform v2 "
"rendezvous operations.");
@@ -4930,9 +4931,14 @@ hid_serv_get_responsible_directories(smartlist_t *responsible_dirs,
do {
routerstatus_t *r = smartlist_get(c->routerstatus_list, i);
if (r->is_hs_dir) {
- smartlist_add(responsible_dirs, r);
+ if (r->dir_port || use_begindir)
+ smartlist_add(responsible_dirs, r);
+ else
+ log_info(LD_REND, "Not adding router '%s' to list of responsible "
+ "hidden service directories, because we have no way of "
+ "reaching it.", r->nickname);
if (++n_added == REND_NUMBER_OF_CONSECUTIVE_REPLICAS)
- return 0;
+ break;
}
if (++i == smartlist_len(c->routerstatus_list))
i = 0;