summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2021-10-21 12:50:28 +0000
committerAlexander Færøy <ahf@torproject.org>2021-10-21 12:50:28 +0000
commitd320f4d2a2b8208d4576be99e85babdd387d10c2 (patch)
treea984a9a6cee0e61157d647b0fa103e36cf5b3253
parent998706c6119d66509978721c29e10495c2bdc16f (diff)
parentb7992d4f793f0aa965e6efde1bca5c03cce95e8e (diff)
downloadtor-d320f4d2a2b8208d4576be99e85babdd387d10c2.tar.gz
tor-d320f4d2a2b8208d4576be99e85babdd387d10c2.zip
Merge remote-tracking branch 'tor-gitlab/mr/442' into main
-rw-r--r--changes/bug404714
-rw-r--r--src/feature/dirauth/dirauth_options.inc3
-rw-r--r--src/feature/dirauth/dirvote.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/changes/bug40471 b/changes/bug40471
new file mode 100644
index 0000000000..323e049599
--- /dev/null
+++ b/changes/bug40471
@@ -0,0 +1,4 @@
+ o Minor bugfixes (dirauth, bandwidth scanner):
+ - Add the AuthDirDontVoteOnDirAuthBandwidth dirauth config parameter to
+ avoid voting on bandwidth scanner weights to v3 directory authorities.
+ Fixes bug 40471; bugfix on 0.2.2.1-alpha. Patch by Neel Chauhan.
diff --git a/src/feature/dirauth/dirauth_options.inc b/src/feature/dirauth/dirauth_options.inc
index 05726b8c2f..307ecbd286 100644
--- a/src/feature/dirauth/dirauth_options.inc
+++ b/src/feature/dirauth/dirauth_options.inc
@@ -109,4 +109,7 @@ CONF_VAR(VersioningAuthoritativeDirectory, BOOL, 0, "0")
* pressure or not. */
CONF_VAR(AuthDirRejectRequestsUnderLoad, BOOL, 0, "1")
+/** Boolean: Should we not give bandwidth weight measurements to dirauths? */
+CONF_VAR(AuthDirDontVoteOnDirAuthBandwidth, BOOL, 0, "1")
+
END_CONF_STRUCT(dirauth_options_t)
diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c
index ffaa78b997..a00e0c0fb0 100644
--- a/src/feature/dirauth/dirvote.c
+++ b/src/feature/dirauth/dirvote.c
@@ -2265,7 +2265,8 @@ networkstatus_compute_consensus(smartlist_t *votes,
smartlist_add_asprintf(chunks, "pr %s\n", chosen_protocol_list);
}
/* Now the weight line. */
- if (rs_out.has_bandwidth) {
+ if (rs_out.has_bandwidth && (!rs_out.is_authority ||
+ !dirauth_get_options()->AuthDirDontVoteOnDirAuthBandwidth)) {
char *guardfraction_str = NULL;
int unmeasured = rs_out.bw_is_unmeasured;