mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Revise earlier check for correct IPv4 addr length to check for ==4.
We need this to match the check in connection_ap_handshake_socks_resolved(). Found by optimist.
This commit is contained in:
parent
845326317d
commit
7f8a6c5e92
@ -925,7 +925,7 @@ connection_edge_process_relay_cell_not_open(
|
||||
2+answer_len));
|
||||
else
|
||||
ttl = -1;
|
||||
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) {
|
||||
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4) {
|
||||
uint32_t addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+2));
|
||||
if (get_options()->ClientDNSRejectInternalAddresses &&
|
||||
is_internal_IP(addr, 0)) {
|
||||
@ -947,7 +947,7 @@ connection_edge_process_relay_cell_not_open(
|
||||
cell->payload+RELAY_HEADER_SIZE+2, /*answer*/
|
||||
ttl,
|
||||
-1);
|
||||
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len >= 4) {
|
||||
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4) {
|
||||
uint32_t addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+2));
|
||||
remap_event_helper(conn, addr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user