aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/or_connection_st.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-16 14:36:54 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-17 11:42:49 -0400
commit7b3bd45cfe400deb2420afa0018c642402cc4f94 (patch)
tree8b3b46311ff19d3f62c177773d58660adb365f73 /src/core/or/or_connection_st.h
parent44da9206701a2b157474f94ccf64996dce192924 (diff)
downloadtor-7b3bd45cfe400deb2420afa0018c642402cc4f94.tar.gz
tor-7b3bd45cfe400deb2420afa0018c642402cc4f94.zip
or_connection_t: replace real_addr with canonical_orport.
Instead of replacing connection_t.{addr,port} with a canonical orport, and tracking the truth in real_addr, we now leave connection_t.addr alone, and put the canonical address in canonical_orport. Closes #40042 Closes #33898
Diffstat (limited to 'src/core/or/or_connection_st.h')
-rw-r--r--src/core/or/or_connection_st.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/or/or_connection_st.h b/src/core/or/or_connection_st.h
index 2507f90803..8e012a6b85 100644
--- a/src/core/or/or_connection_st.h
+++ b/src/core/or/or_connection_st.h
@@ -50,17 +50,18 @@ struct or_connection_t {
channel_tls_t *chan;
/**
- * The actual address (as modified by any proxies) that this connection
- * came from or went to. (See connection_t.addr for caveats.)
+ * The "canonical" address and port for this relay's ORPort, if this is
+ * a known relay.
*
- * TECHNICAL DEBT:
+ * An ORPort is "canonical" in this sense only if it is the same ORPort
+ * that is listed for this identity in the consensus we have.
*
- * This field shouldn't really exist. We need it because our code
- * overwrites conenction_t.addr with the "canonical address" of the OR we
- * are talking to, taken from the descriptor of the authenticated OR.
- * That's a bad choice.
+ * This field may be set on outbound connections for _any_ relay, and on
+ * inbound connections after authentication. If we don't know the relay's
+ * identity, or if we don't have the relay's identity in our consensus, we
+ * leave this address as UNSPEC.
**/
- tor_addr_t real_addr;
+ tor_addr_port_t canonical_orport;
/** Should this connection be used for extending circuits to the server
* matching the <b>identity_digest</b> field? Set to true if we're pretty