mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Add some early checks to keep ipv6 addresses from failing by accident. Now, they fail on purpose, at least till 0.2.2.something.
svn:r17791
This commit is contained in:
parent
374c1e979f
commit
b3b14bf25d
@ -617,10 +617,16 @@ dns_resolve_impl(edge_connection_t *exitconn, int is_resolve,
|
|||||||
/* first check if exitconn->_base.address is an IP. If so, we already
|
/* first check if exitconn->_base.address is an IP. If so, we already
|
||||||
* know the answer. */
|
* know the answer. */
|
||||||
if (tor_addr_from_str(&addr, exitconn->_base.address) >= 0) {
|
if (tor_addr_from_str(&addr, exitconn->_base.address) >= 0) {
|
||||||
|
if (tor_addr_family(&addr) == AF_INET) {
|
||||||
tor_addr_assign(&exitconn->_base.addr, &addr);
|
tor_addr_assign(&exitconn->_base.addr, &addr);
|
||||||
exitconn->address_ttl = DEFAULT_DNS_TTL;
|
exitconn->address_ttl = DEFAULT_DNS_TTL;
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
/* XXXX IPv6 */
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If we're a non-exit, don't even do DNS lookups. */
|
/* If we're a non-exit, don't even do DNS lookups. */
|
||||||
if (!(me = router_get_my_routerinfo()) ||
|
if (!(me = router_get_my_routerinfo()) ||
|
||||||
policy_is_reject_star(me->exit_policy)) {
|
policy_is_reject_star(me->exit_policy)) {
|
||||||
|
@ -1140,6 +1140,10 @@ router_compare_to_my_exit_policy(edge_connection_t *conn)
|
|||||||
if (tor_addr_is_null(&conn->_base.addr))
|
if (tor_addr_is_null(&conn->_base.addr))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* XXXX IPv6 */
|
||||||
|
if (tor_addr_family(&conn->_base.addr) != AF_INET)
|
||||||
|
return -1;
|
||||||
|
|
||||||
return compare_tor_addr_to_addr_policy(&conn->_base.addr, conn->_base.port,
|
return compare_tor_addr_to_addr_policy(&conn->_base.addr, conn->_base.port,
|
||||||
desc_routerinfo->exit_policy) != ADDR_POLICY_ACCEPTED;
|
desc_routerinfo->exit_policy) != ADDR_POLICY_ACCEPTED;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user