From ceb6585a4bc2beadde2fb194395711e72ee8559d Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 22 Jul 2020 15:20:41 -0400 Subject: 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. --- src/feature/relay/ext_orport.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/feature/relay') 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); } - -- cgit v1.2.3-54-g00ecf