diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-04-09 14:44:03 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-04-22 20:00:47 -0400 |
commit | 08373467b10a3e3c4765835d1820f86741b9f307 (patch) | |
tree | 39a2e2e01c4d5bd290009137c22e34292f5e4833 /src/or | |
parent | 69347f48e00ae31222ce10d66c507293954e4fcc (diff) | |
download | tor-08373467b10a3e3c4765835d1820f86741b9f307.tar.gz tor-08373467b10a3e3c4765835d1820f86741b9f307.zip |
Remove MIN_METHOD_FOR and MIN_METHOD_FOR_A_LINES
Also, in networkstatus.c, remove client code for recognizing pre-
MIN_METHOD_FOR_A_LINES consensuses, and corresponding unit tests in
test_dir.c.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/dirvote.c | 15 | ||||
-rw-r--r-- | src/or/dirvote.h | 7 | ||||
-rw-r--r-- | src/or/networkstatus.c | 2 |
3 files changed, 7 insertions, 17 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c index 2657155054..1985d90679 100644 --- a/src/or/dirvote.c +++ b/src/or/dirvote.c @@ -549,12 +549,12 @@ compute_routerstatus_consensus(smartlist_t *votes, int consensus_method, tor_assert(most); - /* If we're producing "a" lines, vote on potential alternative (sets - * of) OR port(s) in the winning routerstatuses. + /* Vote on potential alternative (sets of) OR port(s) in the winning + * routerstatuses. * * XXX prop186 There's at most one alternative OR port (_the_ IPv6 * port) for now. */ - if (consensus_method >= MIN_METHOD_FOR_A_LINES && best_alt_orport_out) { + if (best_alt_orport_out) { smartlist_t *alt_orports = smartlist_new(); const tor_addr_port_t *most_alt_orport = NULL; @@ -1890,10 +1890,8 @@ networkstatus_compute_consensus(smartlist_t *votes, rs_out.published_on = rs->status.published_on; rs_out.dir_port = rs->status.dir_port; rs_out.or_port = rs->status.or_port; - if (consensus_method >= MIN_METHOD_FOR_A_LINES) { - tor_addr_copy(&rs_out.ipv6_addr, &alt_orport.addr); - rs_out.ipv6_orport = alt_orport.port; - } + tor_addr_copy(&rs_out.ipv6_addr, &alt_orport.addr); + rs_out.ipv6_orport = alt_orport.port; rs_out.has_bandwidth = 0; rs_out.has_exitsummary = 0; @@ -3846,8 +3844,7 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method) /* We originally put a lines in the micrdescriptors, but then we worked out * that we needed them in the microdesc consensus. See #20916. */ - if (consensus_method >= MIN_METHOD_FOR_A_LINES && - consensus_method < MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC && + if (consensus_method < MIN_METHOD_FOR_NO_A_LINES_IN_MICRODESC && !tor_addr_is_null(&ri->ipv6_addr) && ri->ipv6_orport) smartlist_add_asprintf(chunks, "a %s\n", fmt_addrport(&ri->ipv6_addr, ri->ipv6_orport)); diff --git a/src/or/dirvote.h b/src/or/dirvote.h index 91da4edeef..9c7916a9be 100644 --- a/src/or/dirvote.h +++ b/src/or/dirvote.h @@ -61,13 +61,6 @@ /** The highest consensus method that we currently support. */ #define MAX_SUPPORTED_CONSENSUS_METHOD 28 -/** Lowest consensus method where microdesc consensuses omit any entry - * with no microdesc. */ -#define MIN_METHOD_FOR_MANDATORY_MICRODESC 13 - -/** Lowest consensus method that contains "a" lines. */ -#define MIN_METHOD_FOR_A_LINES 14 - /** Lowest consensus method where microdescs may include a "p6" line. */ #define MIN_METHOD_FOR_P6_LINES 15 diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 235b95b704..d7088a1670 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1528,7 +1528,7 @@ networkstatus_consensus_has_ipv6(const or_options_t* options) return cons->consensus_method >= MIN_METHOD_FOR_A_LINES_IN_MICRODESC_CONSENSUS; } else { - return cons->consensus_method >= MIN_METHOD_FOR_A_LINES; + return 1; } } |