aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-15 12:58:13 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-15 13:04:12 -0400
commit6aef89bda4800384eddf79e42d965c2b011acdb4 (patch)
tree59bdfe03904c596f884bede76cdddecaa84c9641 /src/or/circuituse.c
parentf40df02f3e26df792b7e364d1b6ea5dab167405c (diff)
downloadtor-6aef89bda4800384eddf79e42d965c2b011acdb4.tar.gz
tor-6aef89bda4800384eddf79e42d965c2b011acdb4.zip
Remove compare_addr_to_node_policy
Instead, use compare_tor_addr_to_node_policy everywhere. One advantage of this is that compare_tor_addr_to_node_policy can better distinguish 0.0.0.0 from "unknown", which caused a nasty bug with microdesc users.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 67677ef050..460c41f75d 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -509,7 +509,7 @@ circuit_stream_is_being_handled(edge_connection_t *conn,
ok = connection_ap_can_use_exit(conn, exitnode);
} else {
addr_policy_result_t r;
- r = compare_addr_to_node_policy(0, port, exitnode);
+ r = compare_tor_addr_to_node_policy(NULL, port, exitnode);
ok = r != ADDR_POLICY_REJECTED && r != ADDR_POLICY_PROBABLY_REJECTED;
}
if (ok) {
@@ -1262,10 +1262,12 @@ circuit_get_open_circ_or_launch(edge_connection_t *conn,
if (check_exit_policy) {
if (!conn->chosen_exit_name) {
struct in_addr in;
- uint32_t addr = 0;
- if (tor_inet_aton(conn->socks_request->address, &in))
- addr = ntohl(in.s_addr);
- if (router_exit_policy_all_nodes_reject(addr,
+ tor_addr_t addr, *addrp=NULL;
+ if (tor_inet_aton(conn->socks_request->address, &in)) {
+ tor_addr_from_in(&addr, &in);
+ addrp = &addr;
+ }
+ if (router_exit_policy_all_nodes_reject(addrp,
conn->socks_request->port,
need_uptime)) {
log_notice(LD_APP,