aboutsummaryrefslogtreecommitdiff
path: root/src/or/command.c
diff options
context:
space:
mode:
authorfrosty <frosty@rootedker.nl>2011-11-03 12:03:05 -0400
committerNick Mathewson <nickm@torproject.org>2011-11-03 12:03:05 -0400
commit3dd2f990a385caec99cad07b5cdcfa8abebcbf6c (patch)
treebc109fc639d7644417ccfab601b222e0cfe8d4a6 /src/or/command.c
parentd029c3223ad0d72b8e065c0e92df734185987acf (diff)
downloadtor-3dd2f990a385caec99cad07b5cdcfa8abebcbf6c.tar
tor-3dd2f990a385caec99cad07b5cdcfa8abebcbf6c.tar.gz
Do not send a NETINFO cell as a client until after we have got a CERT cell
Diffstat (limited to 'src/or/command.c')
-rw-r--r--src/or/command.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/command.c b/src/or/command.c
index c02d353bb..808333e2b 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -688,8 +688,7 @@ command_process_versions_cell(var_cell_t *cell, or_connection_t *conn)
const int send_chall = !started_here && public_server_mode(get_options());
/* If our certs cell will authenticate us, or if we have no intention of
* authenticating, send a netinfo cell right now. */
- const int send_netinfo =
- !(started_here && public_server_mode(get_options()));
+ const int send_netinfo = !started_here;
const int send_any =
send_versions || send_certs || send_chall || send_netinfo;
tor_assert(conn->link_proto >= 3);
@@ -1021,6 +1020,13 @@ command_process_cert_cell(var_cell_t *cell, or_connection_t *conn)
conn->handshake_state->id_cert = id_cert;
id_cert = NULL;
+ if (!public_server_mode(get_options())) {
+ if (connection_or_send_netinfo(conn) < 0) {
+ log_warn(LD_OR, "Couldn't send netinfo cell");
+ connection_mark_for_close(TO_CONN(conn));
+ goto err;
+ }
+ }
} else {
if (! (id_cert && auth_cert))
ERR("The certs we wanted were missing");