diff options
author | George Kadianakis <desnacked@riseup.net> | 2020-08-03 16:49:05 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2020-08-03 16:49:05 +0300 |
commit | e069b0af4b5d5825a23f3bf6a601cc4738599be6 (patch) | |
tree | b861220b09f0c1cb66c26a0c65c10f60e22ac499 /src/core/mainloop | |
parent | ce57404a429b2505f5832954d8a66935a592461a (diff) | |
parent | 18d2c7c5d7eb0441d891fb7642fbbabde6c53cf2 (diff) | |
download | tor-e069b0af4b5d5825a23f3bf6a601cc4738599be6.tar.gz tor-e069b0af4b5d5825a23f3bf6a601cc4738599be6.zip |
Merge branch 'maint-0.4.4'
Diffstat (limited to 'src/core/mainloop')
-rw-r--r-- | src/core/mainloop/connection.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c index d5a46143e9..b89a4ae796 100644 --- a/src/core/mainloop/connection.c +++ b/src/core/mainloop/connection.c @@ -569,8 +569,12 @@ or_connection_new(int type, int socket_family) tor_addr_make_unspec(&or_conn->canonical_orport.addr); 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; } @@ -3316,6 +3320,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))) |