diff options
author | George Kadianakis <desnacked@riseup.net> | 2013-08-05 19:08:14 +0300 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-15 12:03:38 -0400 |
commit | 794447d03db263a0b887db53fc6bcd2c8d24eb71 (patch) | |
tree | 7546ee8a82af09c3734419c8718f5429ddb5a82e /src/or | |
parent | f549e4c36d0658b6255d3b9cf7c56131d4a37a57 (diff) | |
download | tor-794447d03db263a0b887db53fc6bcd2c8d24eb71.tar.gz tor-794447d03db263a0b887db53fc6bcd2c8d24eb71.zip |
Fix some #5040 bugs found by Nick's tests.
- Set conn->address when we receive a USERADDR command.
- Set conn->state to a sane value when we transition from Extended
ORPort to ORPort.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/ext_orport.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c index fdcecacda2..d5a0fa1ee4 100644 --- a/src/or/ext_orport.c +++ b/src/or/ext_orport.c @@ -80,6 +80,7 @@ connection_ext_or_transition(or_connection_t *conn) tor_assert(conn->base_.type == CONN_TYPE_EXT_OR); conn->base_.type = CONN_TYPE_OR; + TO_CONN(conn)->state = 0; // set the state to a neutral value control_event_or_conn_status(conn, OR_CONN_EVENT_NEW, 0); connection_tls_start_handshake(conn, 1); } @@ -474,6 +475,10 @@ connection_ext_or_handle_cmd_useraddr(connection_t *conn, /* record the address */ tor_addr_copy(&conn->addr, &addr); conn->port = port; + if (conn->address) { + tor_free(conn->address); + } + conn->address = tor_dup_addr(&addr); return 0; } |