diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-08-20 14:52:56 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-21 11:28:57 -0400 |
commit | 0daa26a4732234333e67d04c9b215ff6704fa9cd (patch) | |
tree | 1abe16b99d9cf7d5edffe7ed3cc765a6dd022ddb /src/or/command.c | |
parent | 64410cc88888ff964a82613cc53475def98d9de7 (diff) | |
download | tor-0daa26a4732234333e67d04c9b215ff6704fa9cd.tar.gz tor-0daa26a4732234333e67d04c9b215ff6704fa9cd.zip |
Send NETINFO on receiving a NETINFO if we have not yet sent one.
(Backport to Tor 0.2.3)
Relays previously, when initiating a connection, would only send a
NETINFO after sending an AUTHENTICATE. But bridges, when receiving a
connection, would never send AUTH_CHALLENGE. So relays wouldn't
AUTHENTICATE, and wouldn't NETINFO, and then bridges would be
surprised to be receiving CREATE cells on a non-open circuit.
Fixes bug 9546.
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c index 8321e261e0..26e4e6897f 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -941,6 +941,16 @@ command_process_netinfo_cell(cell_t *cell, or_connection_t *conn) * trustworthy. */ (void)my_apparent_addr; + if (! conn->handshake_state->sent_netinfo) { + /* If we were prepared to authenticate, but we never got an AUTH_CHALLENGE + * cell, then we would not previously have sent a NETINFO cell. Do so + * now. */ + if (connection_or_send_netinfo(conn) < 0) { + connection_mark_for_close(TO_CONN(conn)); + return; + } + } + if (connection_or_set_state_open(conn)<0) { log_fn(LOG_PROTOCOL_WARN, LD_OR, "Got good NETINFO cell from %s:%d; but " "was unable to make the OR connection become open.", |