aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/channeltls.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-07-06 09:50:48 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-07-07 10:41:10 -0400
commitf5ce8a2bed833befcee895d4966d5731ad2fdf75 (patch)
tree1e6ebc2197b17260aa46b9d67f71e0bef15130d7 /src/core/or/channeltls.c
parent192d367b411019760f92f58adde7592476341d6b (diff)
downloadtor-f5ce8a2bed833befcee895d4966d5731ad2fdf75.tar.gz
tor-f5ce8a2bed833befcee895d4966d5731ad2fdf75.zip
channel: Consider NETINFO other address as ours
Attempt to learn our address from the NETINFO cell. At this commit, the address won't be used in the descriptor if selected. Next commit will make it happen. Related to #40022 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/channeltls.c')
-rw-r--r--src/core/or/channeltls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c
index fc93ea8d56..9198a8bfbc 100644
--- a/src/core/or/channeltls.c
+++ b/src/core/or/channeltls.c
@@ -72,6 +72,7 @@
#include "core/or/or_handshake_state_st.h"
#include "feature/nodelist/routerinfo_st.h"
#include "core/or/var_cell_st.h"
+#include "src/feature/relay/relay_find_addr.h"
#include "lib/tls/tortls.h"
#include "lib/tls/x509.h"
@@ -1929,8 +1930,11 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan)
"NETINFO cell", "OR");
}
- /* XXX maybe act on my_apparent_addr, if the source is sufficiently
- * trustworthy. */
+ /* Consider our apparent address as a possible suggestion for our address if
+ * we were unable to resolve it previously. The endpoint address is passed
+ * in order to make sure to never consider an address that is the same as
+ * our endpoint. */
+ relay_address_new_suggestion(&my_apparent_addr, &chan->conn->real_addr);
if (! chan->conn->handshake_state->sent_netinfo) {
/* If we were prepared to authenticate, but we never got an AUTH_CHALLENGE