mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Have directory authorities vote on IPv6 OR ports according to the spec
Define new new consensus method 14 adding "a" lines to vote and consensus documents. From proposal 186: As with other data in the vote derived from the descriptor, the consensus will include whichever set of "a" lines are given by the most authorities who voted for the descriptor digest that will be used for the router. This patch implements this.
This commit is contained in:
committed by
Nick Mathewson
parent
485b4b7eee
commit
156ffef249
@@ -797,6 +797,7 @@ test_dir_v3_networkstatus(void)
|
||||
networkstatus_t *vote=NULL, *v1=NULL, *v2=NULL, *v3=NULL, *con=NULL,
|
||||
*con_md=NULL;
|
||||
vote_routerstatus_t *vrs;
|
||||
tor_addr_t addr_ipv6;
|
||||
routerstatus_t *rs;
|
||||
char *v1_text=NULL, *v2_text=NULL, *v3_text=NULL, *consensus_text=NULL, *cp;
|
||||
smartlist_t *votes = smartlist_new();
|
||||
@@ -893,6 +894,9 @@ test_dir_v3_networkstatus(void)
|
||||
rs->addr = 0x99009901;
|
||||
rs->or_port = 443;
|
||||
rs->dir_port = 0;
|
||||
tor_addr_parse(&addr_ipv6, "[1:2:3::4]");
|
||||
tor_addr_copy(&rs->ipv6_addr, &addr_ipv6);
|
||||
rs->ipv6_orport = 4711;
|
||||
rs->is_exit = rs->is_stable = rs->is_fast = rs->is_flagged_running =
|
||||
rs->is_valid = rs->is_v2_dir = rs->is_possible_guard = 1;
|
||||
smartlist_add(vote->routerstatus_list, vrs);
|
||||
@@ -987,6 +991,8 @@ test_dir_v3_networkstatus(void)
|
||||
test_eq(rs->addr, 0x99009901);
|
||||
test_eq(rs->or_port, 443);
|
||||
test_eq(rs->dir_port, 0);
|
||||
test_assert(tor_addr_eq(&rs->ipv6_addr, &addr_ipv6));
|
||||
test_eq(rs->ipv6_orport, 4711);
|
||||
test_eq(vrs->flags, U64_LITERAL(254)); // all flags except "authority."
|
||||
|
||||
{
|
||||
@@ -1169,6 +1175,8 @@ test_dir_v3_networkstatus(void)
|
||||
test_eq(rs->addr, 0x99009901);
|
||||
test_eq(rs->or_port, 443);
|
||||
test_eq(rs->dir_port, 0);
|
||||
test_assert(tor_addr_eq(&rs->ipv6_addr, &addr_ipv6));
|
||||
test_eq(rs->ipv6_orport, 4711);
|
||||
test_assert(!rs->is_authority);
|
||||
test_assert(rs->is_exit);
|
||||
test_assert(rs->is_fast);
|
||||
|
||||
Reference in New Issue
Block a user