]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't build descriptors if ORPort auto is set and we have no OR listener
authorNick Mathewson <nickm@torproject.org>
Wed, 18 May 2011 01:42:35 +0000 (21:42 -0400)
committerSebastian Hahn <sebastian@torproject.org>
Tue, 24 May 2011 19:12:23 +0000 (21:12 +0200)
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.

changes/bug3216 [new file with mode: 0644]
src/or/router.c

diff --git a/changes/bug3216 b/changes/bug3216
new file mode 100644 (file)
index 0000000..599b5e1
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes:
+    - Don't try to build descriptors if "ORPort auto" is set and we
+      don't know our actual ORPort yet.  Fix for bug 3216; bugfix on
+      0.2.2.26-beta.
index 184715b7501d11a6b3dd4cba2f9a103ef9b07a6e..464cba0dbaebb691af7a44702c86193c3fcd4201 100644 (file)
@@ -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();
 }