diff options
author | David Goulet <dgoulet@torproject.org> | 2020-07-21 09:28:52 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-07-21 15:48:05 -0400 |
commit | c3a0f757964de0e8a24911d72abff5df20bb323c (patch) | |
tree | 7d4c6dbc6e7d280df55ecad466d4157ceedcede1 /src/core | |
parent | 354eb0c0102ddc5be301097212a00e27ef40f439 (diff) | |
download | tor-c3a0f757964de0e8a24911d72abff5df20bb323c.tar.gz tor-c3a0f757964de0e8a24911d72abff5df20bb323c.zip |
relay: Automatically Enable an IPv6 ORPort
This commit makes it that if the ORPort is set with a single port, it will
bind to both global listen IPv4 and IPv6 addresses.
To pin an "ORPort <PORT>" to be IPv4 or IPv6, the IPv4Only/IPv6Only flags are
honored thus this will _only_ bind on IPv6 for that port value:
ORPort 9050 IPv6Only
Results in: [::]:9050
ORPort 9051 IPv4Only
Results in: [0.0.0.0]:9051
Attempting to configure an explicit IPv4 address with IPv6Only flag is an
error and vice versa.
Closes #33246
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/port_cfg_st.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/or/port_cfg_st.h b/src/core/or/port_cfg_st.h index 064e679d78..f8ff6f8cc8 100644 --- a/src/core/or/port_cfg_st.h +++ b/src/core/or/port_cfg_st.h @@ -26,6 +26,8 @@ struct port_cfg_t { unsigned is_group_writable : 1; unsigned is_world_writable : 1; unsigned relax_dirmode_check : 1; + unsigned explicit_addr : 1; /** Indicate if address was explicitly set or + * we are using the default address. */ entry_port_cfg_t entry_cfg; |