aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-06-16 16:12:06 -0400
committerNick Mathewson <nickm@torproject.org>2009-06-16 16:40:05 -0400
commit632579f5927dd319e6841b30be88d4388d9041eb (patch)
treea645360ad46e5e7f33197a70acd5c2da7350d47a
parent3a5259ef6841d770171e217925c1838ee7121490 (diff)
downloadtor-632579f5927dd319e6841b30be88d4388d9041eb.tar.gz
tor-632579f5927dd319e6841b30be88d4388d9041eb.zip
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.
-rw-r--r--src/or/relay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index f8c347bd72..40ee3fed05 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -971,7 +971,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)) {
@@ -993,7 +993,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);
}