summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-17 21:42:35 -0400
committerSebastian Hahn <sebastian@torproject.org>2011-05-24 21:12:23 +0200
commit95ac3ea5946f723ddab474fe229a872669aee47f (patch)
tree6609dc7b0aaa1567ef06ffb1e552012503e159a9 /src/or/router.c
parent6cac100b13794b74db8e831bed56df2f0443ea13 (diff)
downloadtor-95ac3ea5946f723ddab474fe229a872669aee47f.tar.gz
tor-95ac3ea5946f723ddab474fe229a872669aee47f.zip
Don't build descriptors if ORPort auto is set and we have no OR listener
This situation can happen easily if you set 'ORPort auto' and 'AccountingMax'. Doing so means that when you have no ORPort, you won't be able to set an ORPort in a descriptor, so instead you would just generate lots of invalid descriptors, freaking out all the time. Possible fix for 3216; fix on 0.2.2.26-beta.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 184715b750..464cba0dba 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -802,6 +802,8 @@ decide_to_advertise_dirport(or_options_t *options, uint16_t dir_port)
return 0;
if (!check_whether_dirport_reachable())
return 0;
+ if (!router_get_advertised_dir_port(options))
+ return 0;
/* Section two: reasons to publish or not publish that the user
* might find surprising. These are generally config options that
@@ -1136,6 +1138,8 @@ decide_if_publishable_server(void)
return 0;
if (authdir_mode(options))
return 1;
+ if (!router_get_advertised_or_port(options))
+ return 0;
return check_whether_orport_reachable();
}