diff options
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/config/config.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index 665732ea56..fa99fb0c88 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -6459,26 +6459,17 @@ parse_dir_authority_line(const char *line, dirinfo_type_t required_type, addrport = smartlist_get(items, 0); smartlist_del_keeporder(items, 0); - const char *addrport_sep = strchr(addrport, ':'); - if (!addrport_sep) { - log_warn(LD_CONFIG, "Error parsing DirAuthority address '%s' " - "(':' not found)", addrport); + if (tor_addr_port_split(LOG_WARN, addrport, &address, &dir_port) < 0) { + log_warn(LD_CONFIG, "Error parsing DirAuthority address '%s'.", addrport); goto err; } - address = tor_strndup(addrport, addrport_sep - addrport); if (!string_is_valid_ipv4_address(address)) { log_warn(LD_CONFIG, "Error parsing DirAuthority address '%s' " "(invalid IPv4 address)", address); goto err; } - tor_free(address); - - if (addr_port_lookup(LOG_WARN, addrport, &address, NULL, &dir_port)<0) { - log_warn(LD_CONFIG, "Error parsing DirAuthority address '%s'", addrport); - goto err; - } if (!dir_port) { log_warn(LD_CONFIG, "Missing port in DirAuthority address '%s'",addrport); goto err; |