diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-12-09 13:10:53 -0500 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2021-01-13 15:23:27 +0200 |
commit | fb3704b45982e6a97dbad4e2d6e9cf7ba8fd1151 (patch) | |
tree | c88820b2837804cfd8825048073915b74928c042 /src/feature/dirauth/dirvote.h | |
parent | 2bfb76b927111824a2051d09b1f5542ee58e2a6f (diff) | |
download | tor-fb3704b45982e6a97dbad4e2d6e9cf7ba8fd1151.tar.gz tor-fb3704b45982e6a97dbad4e2d6e9cf7ba8fd1151.zip |
New consensus method to find bwweightscale & maxunmeasuredbw correctly.
Our original code for parsing these parameters out of our list of
parameters pre-dated us having the
dirvote_get_intermediate_param_value() function... and it was buggy.
Specifically, it would reject any " ... K=V ..." value
where there were additional unconverted characters after the V, and
use the default value instead,
We haven't run into this yet because we've never voted for
bwweightscale to be anything besides the default 10000, or
maxunmeasuredbw to be anything besides the default 20.
This requires a new consensus method because it is a change in how
consensuses are computed.
Fixes bug 19011; bugfix on 0.2.2.10-alpha.
Diffstat (limited to 'src/feature/dirauth/dirvote.h')
-rw-r--r-- | src/feature/dirauth/dirvote.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/feature/dirauth/dirvote.h b/src/feature/dirauth/dirvote.h index 4f48e45dc3..7d30a51d08 100644 --- a/src/feature/dirauth/dirvote.h +++ b/src/feature/dirauth/dirvote.h @@ -53,7 +53,7 @@ #define MIN_SUPPORTED_CONSENSUS_METHOD 28 /** The highest consensus method that we currently support. */ -#define MAX_SUPPORTED_CONSENSUS_METHOD 30 +#define MAX_SUPPORTED_CONSENSUS_METHOD 31 /** * Lowest consensus method where microdescriptor lines are put in canonical @@ -65,6 +65,11 @@ * See #7869 */ #define MIN_METHOD_FOR_UNPADDED_NTOR_KEY 30 +/** Lowest consensus method for which we use the correct algorithm for + * extracting the bwweightscale= and maxunmeasuredbw= parameters. See #19011. + */ +#define MIN_METHOD_FOR_CORRECT_BWWEIGHTSCALE 31 + /** Default bandwidth to clip unmeasured bandwidths to using method >= * MIN_METHOD_TO_CLIP_UNMEASURED_BW. (This is not a consensus method; do not * get confused with the above macros.) */ @@ -256,6 +261,9 @@ STATIC char *networkstatus_get_detached_signatures(smartlist_t *consensuses); STATIC microdesc_t *dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method); +STATIC int64_t extract_param_buggy(const char *params, + const char *param_name, + int64_t default_value); /** The recommended relay protocols for this authority's votes. * Recommending a new protocol causes old tor versions to log a warning. |