aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2022-10-26 15:01:43 -0400
committerDavid Goulet <dgoulet@torproject.org>2022-10-26 15:01:43 -0400
commitca135a127d3641dde301eb7dfa4f50edce878a0e (patch)
tree133c4fc250780a323fc2b3f98a9db2894864a4cb /src/feature/nodelist
parent17207449045589f24eb3f6bedc598898832adecc (diff)
parent0a49e04691b6f6efedadc003521cd0e5809f81da (diff)
downloadtor-ca135a127d3641dde301eb7dfa4f50edce878a0e.tar.gz
tor-ca135a127d3641dde301eb7dfa4f50edce878a0e.zip
Merge branch 'maint-0.4.7'
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r--src/feature/nodelist/fmt_routerstatus.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/feature/nodelist/fmt_routerstatus.c b/src/feature/nodelist/fmt_routerstatus.c
index e068c87c9b..4be2ec2a18 100644
--- a/src/feature/nodelist/fmt_routerstatus.c
+++ b/src/feature/nodelist/fmt_routerstatus.c
@@ -181,9 +181,20 @@ routerstatus_format_entry(const routerstatus_t *rs, const char *version,
smartlist_add_asprintf(chunks,
"w Bandwidth=%d", bw_kb);
+ /* Include the bandwidth weight from our external bandwidth
+ * authority, if we have one. */
if (format == NS_V3_VOTE && vrs && vrs->has_measured_bw) {
- smartlist_add_asprintf(chunks,
- " Measured=%d", vrs->measured_bw_kb);
+ if (!rs->is_authority) { /* normal case */
+ smartlist_add_asprintf(chunks,
+ " Measured=%d", vrs->measured_bw_kb);
+ } else {
+ /* dir auth special case: don't give it a Measured line, so we
+ * can reserve its attention for authority-specific activities.
+ * But do include the bwauth's opinion so it can be recorded for
+ * posterity. See #40698 for details. */
+ smartlist_add_asprintf(chunks,
+ " MeasuredButAuthority=%d", vrs->measured_bw_kb);
+ }
}
/* Write down guardfraction information if we have it. */
if (format == NS_V3_VOTE && vrs && vrs->status.has_guardfraction) {