aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/dirlist.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2021-01-29 14:54:21 -0500
committerDavid Goulet <dgoulet@torproject.org>2021-01-29 14:54:21 -0500
commitb2434d30d2c1071f01d9331752fc7d357169332f (patch)
treefe4b908fc6cfb88c7f0d869f20d4d6a32484c794 /src/feature/nodelist/dirlist.c
parentea380162025d392803a96d331c8dc64bef56f2e7 (diff)
parent705fd37875c4acd61037da6a2680678ae128e4a4 (diff)
downloadtor-b2434d30d2c1071f01d9331752fc7d357169332f.tar.gz
tor-b2434d30d2c1071f01d9331752fc7d357169332f.zip
Merge branch 'tor-gitlab/mr/285' into ticket2667_044_01
Diffstat (limited to 'src/feature/nodelist/dirlist.c')
-rw-r--r--src/feature/nodelist/dirlist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/feature/nodelist/dirlist.c b/src/feature/nodelist/dirlist.c
index 33d1bfc4d0..4317491043 100644
--- a/src/feature/nodelist/dirlist.c
+++ b/src/feature/nodelist/dirlist.c
@@ -55,13 +55,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);
}
}