[or-cvs] [tor/maint-0.2.1] Revise earlier check for correct IPv4 addr length to check for ==4.

Nick Mathewson nickm at seul.org
Tue Jun 16 20:17:58 UTC 2009


Author: Nick Mathewson <nickm at torproject.org>
Date: Tue, 16 Jun 2009 16:12:06 -0400
Subject: Revise earlier check for correct IPv4 addr length to check for ==4.
Commit: 7f8a6c5e92531658e54b243ab00d1f279693a28d

We need this to match the check in connection_ap_handshake_socks_resolved().

Found by optimist.
---
 src/or/relay.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/or/relay.c b/src/or/relay.c
index 9657a82..8099f4f 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -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);
     }
-- 
1.5.6.5



More information about the tor-commits mailing list