aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-22 08:58:17 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-22 08:58:17 -0400
commit91467e04b18afce9af2189116ad0e160fef53e49 (patch)
tree4ddc095a95cecec1b431899841b73e2b5a388bf7 /src/or/connection_edge.c
parent512c57cff97c0533bbb56e6c41a1e3dca5fd9064 (diff)
parent95a7e7e9254bc70db9e1d967d0db3deb658a2be3 (diff)
downloadtor-91467e04b18afce9af2189116ad0e160fef53e49.tar.gz
tor-91467e04b18afce9af2189116ad0e160fef53e49.zip
Merge branch 'bug22805_v2_squashed'
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index e413e5bc36..9098cb6908 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -3434,7 +3434,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)))) {
@@ -3444,10 +3445,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);