diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-14 20:51:41 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-14 23:16:57 -0500 |
commit | bb2145b45ba5992eae6d647b946b430dd2367375 (patch) | |
tree | 8f066e05ceeffd528be75899deab8197996693c4 /src/or/dns.c | |
parent | 85e8d35fca49c0a660e104a85bb727f808b8ffb0 (diff) | |
download | tor-bb2145b45ba5992eae6d647b946b430dd2367375.tar.gz tor-bb2145b45ba5992eae6d647b946b430dd2367375.zip |
Fix a bug in policy_is_reject_star() that was making IPv4 exits break
IPv4-only exits have an implicit "reject [::]/0", which was making
policy_is_reject_star() return 1 for them, making us refuse to do
hostname lookups.
This fix chanes policy_is_reject_star() to ask about which family we meant.
Diffstat (limited to 'src/or/dns.c')
-rw-r--r-- | src/or/dns.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/dns.c b/src/or/dns.c index 6090c459fd..976d188d0b 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -799,7 +799,6 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve, cached_resolve_t search; pending_connection_t *pending_connection; int is_reverse = 0; - const routerinfo_t *me; tor_addr_t addr; time_t now = time(NULL); int r; @@ -824,10 +823,9 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve, } /* If we're a non-exit, don't even do DNS lookups. */ - if (!(me = router_get_my_routerinfo()) || - policy_is_reject_star(me->exit_policy)) { + if (router_my_exit_policy_is_reject_star()) return -1; - } + if (address_is_invalid_destination(exitconn->base_.address, 0)) { log(LOG_PROTOCOL_WARN, LD_EXIT, "Rejecting invalid destination address %s", |