summaryrefslogtreecommitdiff
path: root/src/feature/relay/relay_config.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-07-21 09:28:52 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-21 15:48:05 -0400
commitc3a0f757964de0e8a24911d72abff5df20bb323c (patch)
tree7d4c6dbc6e7d280df55ecad466d4157ceedcede1 /src/feature/relay/relay_config.c
parent354eb0c0102ddc5be301097212a00e27ef40f439 (diff)
downloadtor-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/feature/relay/relay_config.c')
-rw-r--r--src/feature/relay/relay_config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/feature/relay/relay_config.c b/src/feature/relay/relay_config.c
index 7cb7f2ccfd..cddb031f8f 100644
--- a/src/feature/relay/relay_config.c
+++ b/src/feature/relay/relay_config.c
@@ -271,6 +271,14 @@ port_parse_ports_relay(or_options_t *options,
goto err;
}
if (port_parse_config(ports,
+ options->ORPort_lines,
+ "OR", CONN_TYPE_OR_LISTENER,
+ "[::]", 0,
+ CL_PORT_SERVER_OPTIONS) < 0) {
+ *msg = tor_strdup("Invalid ORPort configuration");
+ goto err;
+ }
+ if (port_parse_config(ports,
options->ExtORPort_lines,
"ExtOR", CONN_TYPE_EXT_OR_LISTENER,
"127.0.0.1", 0,