tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 07c008c6723644553827140f2f8a863a1e2d071a
parent 587a7fbcf62447c7ade05c57220f1bfe2f3acdc1
Author: teor <teor@torproject.org>
Date:   Wed, 15 Apr 2020 08:58:32 +1000

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:
Msrc/feature/relay/circuitbuild_relay.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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;