mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'maint-0.3.5' into maint-0.4.3
This commit is contained in:
@@ -383,8 +383,12 @@ or_connection_new(int type, int socket_family)
|
||||
|
||||
connection_or_set_canonical(or_conn, 0);
|
||||
|
||||
if (type == CONN_TYPE_EXT_OR)
|
||||
if (type == CONN_TYPE_EXT_OR) {
|
||||
/* If we aren't told an address for this connection, we should
|
||||
* presume it isn't local, and should be rate-limited. */
|
||||
TO_CONN(or_conn)->always_rate_limit_as_remote = 1;
|
||||
connection_or_set_ext_or_identifier(or_conn);
|
||||
}
|
||||
|
||||
return or_conn;
|
||||
}
|
||||
@@ -3152,6 +3156,7 @@ connection_is_rate_limited(const connection_t *conn)
|
||||
if (conn->linked)
|
||||
return 0; /* Internal connection */
|
||||
else if (! options->CountPrivateBandwidth &&
|
||||
! conn->always_rate_limit_as_remote &&
|
||||
(tor_addr_family(&conn->addr) == AF_UNSPEC || /* no address */
|
||||
tor_addr_family(&conn->addr) == AF_UNIX || /* no address */
|
||||
tor_addr_is_internal(&conn->addr, 0)))
|
||||
|
||||
Reference in New Issue
Block a user