[or-cvs] bugfix: we were automatically condemning an exit node (conc...

arma at seul.org arma at seul.org
Fri Sep 9 06:11:39 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	relay.c 
Log Message:
bugfix: we were automatically condemning an exit node (concluding
its advertised exit policy is different from its real one) as soon
as it refused any requests.
After fixing that bug, another bug appeared: we would try the same
server again and again, since once we learned an IP address for a
hostname, we still kept think of it as the hostname. now pass it to
the remapper before trying to reattach.


Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- relay.c	3 Sep 2005 02:14:31 -0000	1.80
+++ relay.c	9 Sep 2005 06:11:37 -0000	1.81
@@ -657,13 +657,16 @@
         /* check if he *ought* to have allowed it */
         if (exitrouter &&
             (rh->length < 5 ||
-             (!tor_inet_aton(conn->socks_request->address, &in) &&
+             (tor_inet_aton(conn->socks_request->address, &in) &&
               !conn->chosen_exit_name))) {
           log_fn(LOG_NOTICE,"Exitrouter '%s' seems to be more restrictive than its exit policy. Not using this router as exit for now.", exitrouter->nickname);
           addr_policy_free(exitrouter->exit_policy);
           exitrouter->exit_policy =
             router_parse_addr_policy_from_string("reject *:*", -1);
         }
+        /* rewrite it to an IP if we learned one. */
+        addressmap_rewrite(conn->socks_request->address,
+                           sizeof(conn->socks_request->address));
         if (connection_ap_detach_retriable(conn, circ) >= 0)
           return 0;
         /* else, conn will get closed below */



More information about the tor-commits mailing list