diff options
author | David Goulet <dgoulet@torproject.org> | 2021-01-29 14:51:38 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-01-29 14:51:38 -0500 |
commit | 705fd37875c4acd61037da6a2680678ae128e4a4 (patch) | |
tree | ad5d4c14bacfda66b55e8ab4cac31c90faac5d21 /src/feature/nodelist/dirlist.c | |
parent | 79cb47cfc2ed83911f78fa24ba4205bf69958105 (diff) | |
parent | 9eba65bd8b688497de139b57ac72e5b8a40bb728 (diff) | |
download | tor-705fd37875c4acd61037da6a2680678ae128e4a4.tar.gz tor-705fd37875c4acd61037da6a2680678ae128e4a4.zip |
Merge branch 'tor-gitlab/mr/284' into ticket2667_043_01
Diffstat (limited to 'src/feature/nodelist/dirlist.c')
-rw-r--r-- | src/feature/nodelist/dirlist.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/feature/nodelist/dirlist.c b/src/feature/nodelist/dirlist.c index ad3af0a143..883564e080 100644 --- a/src/feature/nodelist/dirlist.c +++ b/src/feature/nodelist/dirlist.c @@ -54,13 +54,18 @@ static smartlist_t *fallback_dir_servers = NULL; static void add_trusted_dir_to_nodelist_addr_set(const dir_server_t *dir) { + tor_addr_t tmp_addr; + tor_assert(dir); tor_assert(dir->is_authority); - /* Add IPv4 and then IPv6 if applicable. */ - nodelist_add_addr4_to_address_set(dir->addr); + /* Add IPv4 and then IPv6 if applicable. For authorities, we add the ORPort + * and DirPort so re-entry into the network back to them is not possible. */ + tor_addr_from_ipv4h(&tmp_addr, dir->addr); + nodelist_add_addr_to_address_set(&tmp_addr, dir->or_port, dir->dir_port); if (!tor_addr_is_null(&dir->ipv6_addr)) { - nodelist_add_addr6_to_address_set(&dir->ipv6_addr); + /* IPv6 DirPort is not a thing yet for authorities. */ + nodelist_add_addr_to_address_set(&dir->ipv6_addr, dir->ipv6_orport, 0); } } |