GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still and

Commit d04a27be authored by David Goulet's avatar David Goulet 🐋

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 #40195Signed-off-by: David Goulet's avatarDavid Goulet <>
parent b13f32ee
Pipeline #1720 canceled with stage
o Minor bugfixes (configuration, ports):
- Fix an issue where an ORPort was validated against other type of ports
when it should have been only checked against other ORPorts. This lead to
"DirPort auto" to be ignored and failing to be used. Fixes bug 40195;
bugfix on
......@@ -227,6 +227,10 @@ remove_duplicate_orports(smartlist_t *ports)
if (removing[j]) {
/* Skip non ORPorts. */
if (next->type != CONN_TYPE_OR_LISTENER) {
/* Same address family and same port number, we have a match. */
if (tor_addr_family(&current->addr) == tor_addr_family(&next->addr) &&
current->port == next->port) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment