summaryrefslogtreecommitdiff
path: root/src/feature/relay
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-22 15:20:41 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-22 15:21:56 -0400
commitceb6585a4bc2beadde2fb194395711e72ee8559d (patch)
tree49e2c28d001d9f11daf0b2c60df768b912115794 /src/feature/relay
parentc9751e26119e375fcbc74107e89958957c00ee5e (diff)
downloadtor-ceb6585a4bc2beadde2fb194395711e72ee8559d.tar.gz
tor-ceb6585a4bc2beadde2fb194395711e72ee8559d.zip
Treat all extorport connections with un-set addresses as remote
Without this fix, if an PT forgets to send a USERADDR command, that results in a connection getting treated as local for the purposes of rate-limiting. If the PT _does_ use USERADDR, we still believe it. Closes ticket 33747.
Diffstat (limited to 'src/feature/relay')
-rw-r--r--src/feature/relay/ext_orport.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/feature/relay/ext_orport.c b/src/feature/relay/ext_orport.c
index 56c5bb96f5..136aee3084 100644
--- a/src/feature/relay/ext_orport.c
+++ b/src/feature/relay/ext_orport.c
@@ -494,6 +494,10 @@ connection_ext_or_handle_cmd_useraddr(connection_t *conn,
}
conn->address = tor_addr_to_str_dup(&addr);
+ /* Now that we know the address, we don't have to manually override rate
+ * limiting. */
+ conn->always_rate_limit_as_remote = 0;
+
return 0;
}
@@ -659,4 +663,3 @@ ext_orport_free_all(void)
if (ext_or_auth_cookie) /* Free the auth cookie */
tor_free(ext_or_auth_cookie);
}
-