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

[or-cvs] r8226: Fix bug 314: Instead of checking address_in_virtualrange, ch (in tor/trunk: . doc src/or)



Author: nickm
Date: 2006-08-25 17:16:22 -0400 (Fri, 25 Aug 2006)
New Revision: 8226

Modified:
   tor/trunk/
   tor/trunk/doc/TODO
   tor/trunk/src/or/buffers.c
   tor/trunk/src/or/circuituse.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/or.h
Log:
 r8576@Kushana:  nickm | 2006-08-25 17:16:01 -0400
 Fix bug 314: Instead of checking address_in_virtualrange, check addressmap_have_mapping().  This should be more accurate.  [Rename to addressmap_have_mapping() from addressmap_already_mapped().]



Property changes on: tor/trunk
___________________________________________________________________
Name: svk:merge
   - 17f730b7-d419-0410-b50f-85ee4b70197a:/local/or/tor/trunk:8290
1f724f9b-111a-0410-b636-93f1a77c1813:/local/or/tor/trunk:8207
96637b51-b116-0410-a10e-9941ebb49b64:/tor/branches/spec:7005
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:8557
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/mmap:7030
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/trans-ap:7315
c95137ef-5f19-0410-b913-86e773d04f59:/tor/trunk:8573
   + 17f730b7-d419-0410-b50f-85ee4b70197a:/local/or/tor/trunk:8290
1f724f9b-111a-0410-b636-93f1a77c1813:/local/or/tor/trunk:8207
96637b51-b116-0410-a10e-9941ebb49b64:/tor/branches/spec:7005
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:8557
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/mmap:7030
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/trans-ap:7315
c95137ef-5f19-0410-b913-86e773d04f59:/tor/trunk:8576

Modified: tor/trunk/doc/TODO
===================================================================
--- tor/trunk/doc/TODO	2006-08-25 21:02:01 UTC (rev 8225)
+++ tor/trunk/doc/TODO	2006-08-25 21:16:22 UTC (rev 8226)
@@ -24,12 +24,12 @@
     until we've fetched correct ones.
   - If the client's clock is too far in the past, it will drop (or
     just not try to get) descriptors, so it'll never build circuits.
-  - bug #308: if Tor writes a bad datestamp to its datadir files, it
+  o bug #308: if Tor writes a bad datestamp to its datadir files, it
     will then refuse to start even if you fix your clock.
 
 Items for 0.1.2.x:
   o bug #280: getaddrinfo does not set hints
-  - bug #314: is the fix for this just to check not only
+  o bug #314: is the fix for this just to check not only
     address_is_in_virtual_range(req->address) but also to check whether
     ent = strmap_get(addressmap, address) and ent->new_address is set?
   - when we start, remove any entryguards that are listed in excludenodes.

Modified: tor/trunk/src/or/buffers.c
===================================================================
--- tor/trunk/src/or/buffers.c	2006-08-25 21:02:01 UTC (rev 8225)
+++ tor/trunk/src/or/buffers.c	2006-08-25 21:16:22 UTC (rev 8226)
@@ -995,7 +995,7 @@
           strlcpy(req->address,tmpbuf,sizeof(req->address));
           req->port = ntohs(*(uint16_t*)(buf->cur+8));
           buf_remove_from_front(buf, 10);
-          if (!address_is_in_virtual_range(req->address) &&
+          if (!addressmap_have_mapping(req->address) &&
               !have_warned_about_unsafe_socks) {
             log_warn(LD_APP,
                 "Your application (using socks5 on port %d) is giving "
@@ -1091,7 +1091,7 @@
 
       startaddr = NULL;
       if (socks4_prot != socks4a &&
-          !address_is_in_virtual_range(tmpbuf) &&
+          !addressmap_have_mapping(tmpbuf) &&
           !have_warned_about_unsafe_socks) {
         log_warn(LD_APP,
                  "Your application (using socks4 on port %d) is giving Tor "

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2006-08-25 21:02:01 UTC (rev 8225)
+++ tor/trunk/src/or/circuituse.c	2006-08-25 21:16:22 UTC (rev 8226)
@@ -1069,7 +1069,7 @@
   /* Search the addressmap for this conn's destination. */
   /* If he's not in the address map.. */
   if (!options->TrackHostExits ||
-      addressmap_already_mapped(conn->socks_request->address))
+      addressmap_have_mapping(conn->socks_request->address))
     return; /* nothing to track, or already mapped */
 
   SMARTLIST_FOREACH(options->TrackHostExits, const char *, cp, {

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-08-25 21:02:01 UTC (rev 8225)
+++ tor/trunk/src/or/connection_edge.c	2006-08-25 21:16:22 UTC (rev 8226)
@@ -645,9 +645,9 @@
 
 /** Return 1 if <b>address</b> is already registered, else return 0 */
 int
-addressmap_already_mapped(const char *address)
+addressmap_have_mapping(const char *address)
 {
-  return strmap_get(addressmap, address) ? 1 : 0;
+  return strmap_get_lc(addressmap, address) ? 1 : 0;
 }
 
 /** Register a request to map <b>address</b> to <b>new_address</b>,

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-08-25 21:02:01 UTC (rev 8225)
+++ tor/trunk/src/or/or.h	2006-08-25 21:16:22 UTC (rev 8226)
@@ -1913,7 +1913,7 @@
 void addressmap_clear_transient(void);
 void addressmap_free_all(void);
 void addressmap_rewrite(char *address, size_t maxlen);
-int addressmap_already_mapped(const char *address);
+int addressmap_have_mapping(const char *address);
 void addressmap_register(const char *address, char *new_address,
                          time_t expires);
 int parse_virtual_addr_network(const char *val, int validate_only,