summaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2018-01-15 22:33:40 -0500
committerRoger Dingledine <arma@torproject.org>2018-01-15 22:33:40 -0500
commitaf8cadf3a9febe3dbe22899b828f9f7946a82cef (patch)
treedd6d3466b7aea51446ca073ce93f621c9fa670a1 /src/or/connection_or.c
parente3ab27001f81dc05eb1dd1ac8371a35ccce2b50d (diff)
downloadtor-af8cadf3a9febe3dbe22899b828f9f7946a82cef.tar.gz
tor-af8cadf3a9febe3dbe22899b828f9f7946a82cef.zip
Remove false positives from channel_is_client()
Fix a set of false positives where relays would consider connections to other relays as being client-only connections (and thus e.g. deserving different link padding schemes) if those relays fell out of the consensus briefly. Now we look only at the initial handshake and whether the connection authenticated as a relay. Fixes bug 24898; bugfix on 0.3.1.1-alpha.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 59a9bdffda..fcd281da26 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1952,6 +1952,12 @@ connection_or_set_state_open(or_connection_t *conn)
connection_or_change_state(conn, OR_CONN_STATE_OPEN);
control_event_or_conn_status(conn, OR_CONN_EVENT_CONNECTED, 0);
+ /* Link protocol 3 appeared in Tor 0.2.3.6-alpha, so any connection
+ * that uses an earlier link protocol should not be treated as a relay. */
+ if (conn->link_proto < 3) {
+ channel_mark_client(TLS_CHAN_TO_BASE(conn->chan));
+ }
+
or_handshake_state_free(conn->handshake_state);
conn->handshake_state = NULL;
connection_start_reading(TO_CONN(conn));