]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Revise earlier check for correct IPv4 addr length to check for ==4.
authorNick Mathewson <nickm@torproject.org>
Tue, 16 Jun 2009 20:12:06 +0000 (16:12 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 16 Jun 2009 20:12:06 +0000 (16:12 -0400)
We need this to match the check in connection_ap_handshake_socks_resolved().

Found by optimist.

src/or/relay.c

index 9657a82956e10b766f39188f3cf23ff2179984df..8099f4f072723ecb4d2bb72c3d1271291585599d 100644 (file)
@@ -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);
     }