]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs: Use hs_service_max_rdv_failures consensus param, defaulting to 2
authorRoger Dingledine <arma@torproject.org>
Fri, 19 Jan 2018 08:00:43 +0000 (03:00 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Fri, 19 Jan 2018 21:13:54 +0000 (16:13 -0500)
changes/bug24895
src/or/rendservice.c

index 7b90f6d260c75068d4a94e15750c3a96fc27b549..7edde94a0bd55402c4dcff5711a7a19bd3f53c9b 100644 (file)
@@ -1,6 +1,8 @@
   o Major bugfixes (onion services):
-    - Fix an "off by 2" error in counting rendezvous failures on the
-      onion service side. While we thought we would stop the rendezvous
-      attempt after one failed circuit, we were actually making three
-      circuit attempts before giving up. Fixes bug 24895; bugfix on 0.0.6.
+    - Fix an "off by 2" error in counting rendezvous failures on the onion
+      service side. While we thought we would stop the rendezvous attempt
+      after one failed circuit, we were actually making three circuit attempts
+      before giving up. Now switch to a default of 2, and allow the consensus
+      parameter "hs_service_max_rdv_failures" to override. Fixes bug 24895;
+      bugfix on 0.0.6.
 
index b503eda7ffe3b112d1fe7c4fba4b9d2f6627fbf9..da200d1381fb6404e612c20aab1b4a2f1a1bb639 100644 (file)
@@ -111,13 +111,21 @@ struct rend_service_port_config_s {
 /** How many seconds should we spend trying to connect to a requested
  * rendezvous point before giving up? */
 #define MAX_REND_TIMEOUT 30
+/* Default, minimum and maximum values for the maximum rendezvous failures
+ * consensus parameter. */
+#define MAX_REND_FAILURES_DEFAULT 2
+#define MAX_REND_FAILURES_MIN 1
+#define MAX_REND_FAILURES_MAX 10
 
 /** How many times will a hidden service operator attempt to connect to
  * a requested rendezvous point before giving up? */
 static int
 get_max_rend_failures(void)
 {
-  return 1;
+  return networkstatus_get_param(NULL, "hs_service_max_rdv_failures",
+                                 MAX_REND_FAILURES_DEFAULT,
+                                 MAX_REND_FAILURES_MIN,
+                                 MAX_REND_FAILURES_MAX);
 }
 
 /* Hidden service directory file names: