diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-09-06 14:39:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-22 08:55:53 -0400 |
commit | 66aff2d8f35217cc802bd46eeeaf49326d7de4b0 (patch) | |
tree | bca747b7248a034b77bcd8cb0384c0d8526d73c0 /src/or/connection_edge.c | |
parent | ab18e5e5fcff7fbdbf0905e6dd2585b7e4a10108 (diff) | |
download | tor-66aff2d8f35217cc802bd46eeeaf49326d7de4b0.tar.gz tor-66aff2d8f35217cc802bd46eeeaf49326d7de4b0.zip |
Remove or_circuit_t.is_first_hop; use channel_is_client() instead
The is_first_hop field should have been called used_create_fast,
but everywhere that we wanted to check it, we should have been
checking channel_is_client() instead.
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index a9fdeee0ee..82dad60fc5 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -3413,7 +3413,8 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) port = bcell.port; if (or_circ && or_circ->p_chan) { - if ((or_circ->is_first_hop || + const int client_chan = channel_is_client(or_circ->p_chan); + if ((client_chan || (!connection_or_digest_is_known_relay( or_circ->p_chan->identity_digest) && should_refuse_unknown_exits(options)))) { @@ -3423,10 +3424,10 @@ connection_exit_begin_conn(cell_t *cell, circuit_t *circ) log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, "Attempt by %s to open a stream %s. Closing.", safe_str(channel_get_canonical_remote_descr(or_circ->p_chan)), - or_circ->is_first_hop ? "on first hop of circuit" : - "from unknown relay"); + client_chan ? "on first hop of circuit" : + "from unknown relay"); relay_send_end_cell_from_edge(rh.stream_id, circ, - or_circ->is_first_hop ? + client_chan ? END_STREAM_REASON_TORPROTOCOL : END_STREAM_REASON_MISC, NULL); |