mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Clarify logic in router_should_skip_orport_reachability_check_family()
The '!=' checks were confusing the issue of what the code was really doing.
This commit is contained in:
parent
b365179ee0
commit
ac648fa307
@ -96,12 +96,16 @@ router_should_skip_orport_reachability_check_family(
|
||||
return true;
|
||||
}
|
||||
|
||||
if (family != AF_INET6) {
|
||||
// Which reachability flags should we look at?
|
||||
const bool checking_ipv4 = (family == AF_INET || family == 0);
|
||||
const bool checking_ipv6 = (family == AF_INET6 || family == 0);
|
||||
|
||||
if (checking_ipv4) {
|
||||
if (have_orport_for_family(AF_INET) && !can_reach_or_port_ipv4) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (family != AF_INET) {
|
||||
if (checking_ipv6) {
|
||||
if (have_orport_for_family(AF_INET6) && !can_reach_or_port_ipv6) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user