[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make address_is_invalid_destination recognize ipv6 addrs as valid.



commit 35ce42118fa84825b4eca5e53617563100c8477e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Nov 6 13:35:31 2012 -0500

    Make address_is_invalid_destination recognize ipv6 addrs as valid.
---
 src/or/addressmap.c |    7 +++++++
 src/or/dns.c        |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/or/addressmap.c b/src/or/addressmap.c
index 75cfca6..98448eb 100644
--- a/src/or/addressmap.c
+++ b/src/or/addressmap.c
@@ -902,6 +902,13 @@ address_is_invalid_destination(const char *address, int client)
       return 0;
   }
 
+  /* It might be an IPv6 address! */
+  {
+    tor_addr_t a;
+    if (tor_addr_parse(&a, address) >= 0)
+      return 0;
+  }
+
   while (*address) {
     if (TOR_ISALNUM(*address) ||
         *address == '-' ||
diff --git a/src/or/dns.c b/src/or/dns.c
index 0758279..780cae0 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -1334,7 +1334,7 @@ make_pending_resolve_cached(cached_resolve_t *resolve)
     cached_resolve_t *new_resolve = tor_memdup(resolve,
                                                sizeof(cached_resolve_t));
     uint32_t ttl = UINT32_MAX;
-    new_resolve->expiry = 0; /* So that set_expiry won't croak. */
+    new_resolve->expire = 0; /* So that set_expiry won't croak. */
     if (resolve->res_status_hostname == RES_STATUS_DONE_OK)
       new_resolve->result_ptr.hostname =
         tor_strdup(resolve->result_ptr.hostname);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits