diff options
author | teor <teor@torproject.org> | 2020-04-15 08:58:32 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-04-29 22:43:09 +1000 |
commit | 07c008c6723644553827140f2f8a863a1e2d071a (patch) | |
tree | dd875dc7cdaba0774d057ae6704c2fca9b3c98dc /src/feature/relay/circuitbuild_relay.c | |
parent | 587a7fbcf62447c7ade05c57220f1bfe2f3acdc1 (diff) | |
download | tor-07c008c6723644553827140f2f8a863a1e2d071a.tar.gz tor-07c008c6723644553827140f2f8a863a1e2d071a.zip |
relay: Refactor address and port checks
tor_addr_port_is_valid_ap(ap, 0) checks if the address or port are
zero, exactly like the previous code.
Preparation for 33817.
Diffstat (limited to 'src/feature/relay/circuitbuild_relay.c')
-rw-r--r-- | src/feature/relay/circuitbuild_relay.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c index 2fa92eeac1..96b46bb65a 100644 --- a/src/feature/relay/circuitbuild_relay.c +++ b/src/feature/relay/circuitbuild_relay.c @@ -139,7 +139,7 @@ circuit_extend_lspec_valid_helper(const struct extend_cell_t *ec, return -1; } - if (!ec->orport_ipv4.port || tor_addr_is_null(&ec->orport_ipv4.addr)) { + if (!tor_addr_port_is_valid_ap(&ec->orport_ipv4, 0)) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Client asked me to extend to zero destination port or addr."); return -1; |