aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-24 11:55:08 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-24 18:05:37 -0400
commit0e1fad648d22923d7455b94734df36585b8f624f (patch)
tree6de6bacd5e30277f9d45669efba2872a7657aff9 /src/or/router.c
parent95ac3ea5946f723ddab474fe229a872669aee47f (diff)
downloadtor-0e1fad648d22923d7455b94734df36585b8f624f.tar
tor-0e1fad648d22923d7455b94734df36585b8f624f.tar.gz
Don't try to build descriptors when router_get_advertised_or_port()==0
The previous attempt was incomplete: it told us not to publish a descriptor, but didn't stop us from generating one. Now we treat an absent OR port the same as not knowing our address. (This means that when we _do_ get an OR port, we need to mark the descriptor dirty.) More attempt to fix bug3216.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 464cba0db..5fd7b06af 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1423,7 +1423,8 @@ router_rebuild_descriptor(int force)
if (desc_clean_since && !force)
return 0;
- if (router_pick_published_address(options, &addr) < 0) {
+ if (router_pick_published_address(options, &addr) < 0 ||
+ router_get_advertised_or_port(options) == 0) {
/* Stop trying to rebuild our descriptor every second. We'll
* learn that it's time to try again when ip_address_changed()
* marks it dirty. */