diff options
author | David Goulet <dgoulet@torproject.org> | 2020-11-17 09:40:16 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-11-17 09:40:16 -0500 |
commit | d04a27bed20cf44766fc30583c7a00108f42a09a (patch) | |
tree | 202ccb15a7a240e13999d45e62ed5dcbb58afe33 /src/feature/relay | |
parent | b13f32ee97e9a10e578c6f01775a1e2449b28693 (diff) | |
download | tor-d04a27bed20cf44766fc30583c7a00108f42a09a.tar.gz tor-d04a27bed20cf44766fc30583c7a00108f42a09a.zip |
config: Really ignore non ORPorts when removing duplicates
The function in charge of removing duplicate ORPorts from our configured ports
was skipping all non ORPorts port but only for the outer loop thus resulting
in comparing an ORPort with a non-ORPort which lead to problems.
For example, tor configured with the following would fail:
ORPort auto
DirPort auto
Both end up being the same configuration except that one is a OR listener and
one is a Dir listener. Thus because of the missing check in the inner loop,
they looked exactly the same and thus one is removed.
Fixes #40195
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/relay')
-rw-r--r-- | src/feature/relay/relay_config.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/feature/relay/relay_config.c b/src/feature/relay/relay_config.c index ea03f43e13..e8c29fa7ed 100644 --- a/src/feature/relay/relay_config.c +++ b/src/feature/relay/relay_config.c @@ -227,6 +227,10 @@ remove_duplicate_orports(smartlist_t *ports) if (removing[j]) { continue; } + /* Skip non ORPorts. */ + if (next->type != CONN_TYPE_OR_LISTENER) { + continue; + } /* Same address family and same port number, we have a match. */ if (tor_addr_family(¤t->addr) == tor_addr_family(&next->addr) && current->port == next->port) { |