]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
should_disable_dir_fetches() now returns 1 if DisableNetwork==1
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Mar 2014 14:42:49 +0000 (10:42 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 14 Mar 2014 14:42:49 +0000 (10:42 -0400)
This change prevents LD_BUG warnings and bootstrap failure messages
when we try to do directory fetches when starting with
DisableNetwork == 1, a consensus present, but no descriptors (or
insufficient descriptors) yet.

Fixes bug 11200 and bug 10405.  It's a bugfix on 0.2.3.9-alpha.
Thanks to mcs for walking me through the repro instructions!

changes/bug11200 [new file with mode: 0644]
src/or/networkstatus.c

diff --git a/changes/bug11200 b/changes/bug11200
new file mode 100644 (file)
index 0000000..b4b61c9
--- /dev/null
@@ -0,0 +1,5 @@
+  - Minor bugfixes:
+
+    - Avoid generating spurious warnings and failure messages when
+      starting with DisableNetwork enabled. Fixes bug 11200 and bug
+      10405; bugfix on 0.2.3.9-alpha.
index 49478a7341677b973dc17ffdce6a0556b6e1fecc..1819c4ef7162fe4b8120ce86d35fb670176dcfef 100644 (file)
@@ -898,6 +898,14 @@ should_delay_dir_fetches(const or_options_t *options, const char **msg_out)
     *msg_out = NULL;
   }
 
+  if (options->DisableNetwork) {
+    if (msg_out) {
+      *msg_out = "DisableNetwork is set.";
+    }
+    log_info(LD_DIR, "Delaying dir fetches (DisableNetwork is set)");
+    return 1;
+  }
+
   if (options->UseBridges) {
     if (!any_bridge_descriptors_known()) {
       if (msg_out) {