[or-cvs] [tor/master] Bug #919: Don't rebind ports if we receive SIGHUP while hibernating.

nickm at torproject.org nickm at torproject.org
Mon Aug 2 16:11:31 UTC 2010


Author: Chris Ball <chris at printf.net>
Date: Sat, 31 Jul 2010 22:35:20 -0400
Subject: Bug #919: Don't rebind ports if we receive SIGHUP while hibernating.
Commit: 73a4c0690edd49ea8fec2b8034bc2b0b681acdb0

---
 changes/bug919  |    4 ++++
 src/or/config.c |   10 ++++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 changes/bug919

diff --git a/changes/bug919 b/changes/bug919
new file mode 100644
index 0000000..728b821
--- /dev/null
+++ b/changes/bug919
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fix a regression that caused Tor to rebind its ports if it receives
+      SIGHUP while hibernating.  Bugfix in 0.1.1.6-alpha, closes bug 919.
+
diff --git a/src/or/config.c b/src/or/config.c
index 20ae9f0..46066b1 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -950,10 +950,12 @@ options_act_reversible(or_options_t *old_options, char **msg)
     }
 
     /* Launch the listeners.  (We do this before we setuid, so we can bind to
-     * ports under 1024.) */
-    if (retry_all_listeners(replaced_listeners, new_listeners) < 0) {
-      *msg = tor_strdup("Failed to bind one of the listener ports.");
-      goto rollback;
+     * ports under 1024.)  We don't want to rebind if we're hibernating. */
+    if (!we_are_hibernating()) {
+      if (retry_all_listeners(replaced_listeners, new_listeners) < 0) {
+        *msg = tor_strdup("Failed to bind one of the listener ports.");
+        goto rollback;
+      }
     }
   }
 
-- 
1.7.1



More information about the tor-commits mailing list