mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
Fix some error-checking logic and a misleading error message
When IPv4Only (IPv6Only) was used but the address could not be interpreted as a IPv4 (IPv6) address, the error message referred to the wrong IP version. This also fixes up the error-checking logic so it's more precise about what's being checked. Fixes bug 13221; bugfix on 0.2.3.9-alpha Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
This commit is contained in:
parent
a3f9ddcf03
commit
1b9e77349f
5
changes/bug13221
Normal file
5
changes/bug13221
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
o Minor bugfixes (logging):
|
||||||
|
- Correct a misleading error message when IPv4Only or IPv6Only
|
||||||
|
is used but the resolved address can not be interpreted as an
|
||||||
|
address of the specified IP version. Fixes bug 13221; bugfix
|
||||||
|
on 0.2.3.9-alpha. Patch from Kris Katterjohn.
|
@ -6650,13 +6650,13 @@ parse_port_config(smartlist_t *out,
|
|||||||
portname, escaped(ports->value));
|
portname, escaped(ports->value));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (bind_ipv4_only && tor_addr_family(&addr) == AF_INET6) {
|
if (bind_ipv4_only && tor_addr_family(&addr) != AF_INET) {
|
||||||
log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv6",
|
log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv4",
|
||||||
portname);
|
portname);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
if (bind_ipv6_only && tor_addr_family(&addr) == AF_INET) {
|
if (bind_ipv6_only && tor_addr_family(&addr) != AF_INET6) {
|
||||||
log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv4",
|
log_warn(LD_CONFIG, "Could not interpret %sPort address as IPv6",
|
||||||
portname);
|
portname);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user