Browse Source

Stop parse_client_port_config() from misinterpreting FooListenAddress and FooPort in legacy syntax

Previously the FooPort was ignored and the default used instead,
causing Tor to bind to the wrong port if FooPort and the default
port don't match or the CONN_TYPE_FOO_LISTENER has no default port.

Fixes #3936.
Fabian Keil 14 years ago
parent
commit
c6f6b567e0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/or/config.c

+ 1 - 1
src/or/config.c

@@ -5019,7 +5019,7 @@ parse_client_port_config(smartlist_t *out,
      if (out) {
      if (out) {
        port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t));
        port_cfg_t *cfg = tor_malloc_zero(sizeof(port_cfg_t));
        cfg->type = listener_type;
        cfg->type = listener_type;
-       cfg->port = port ? port : defaultport;
+       cfg->port = port ? port : mainport;
        tor_addr_copy(&cfg->addr, &addr);
        tor_addr_copy(&cfg->addr, &addr);
        cfg->session_group = SESSION_GROUP_UNSET;
        cfg->session_group = SESSION_GROUP_UNSET;
        cfg->isolation_flags = ISO_DEFAULT;
        cfg->isolation_flags = ISO_DEFAULT;