mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user