diff options
author | David Goulet <dgoulet@torproject.org> | 2017-04-05 16:28:37 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-04-05 16:28:37 -0400 |
commit | 0fdad78fe1f20955ba1c0c93c752e20063c0bb58 (patch) | |
tree | 458da1a0171d264a6b0e387e980a6f9d9b89d35b /src/or/relay.c | |
parent | 0e5e5ba64bab49d056814bc933ab3c4c0a0f5a74 (diff) | |
download | tor-0fdad78fe1f20955ba1c0c93c752e20063c0bb58.tar.gz tor-0fdad78fe1f20955ba1c0c93c752e20063c0bb58.zip |
cell: Do not warn on hidden service invalid port
When a client tried to connect to an invalid port of an hidden service, a
warning was printed:
[warn] connection_edge_process_relay_cell (at origin) failed.
This is because the connection subsystem wants to close the circuit because
the port can't be found and then returns a negative reason to achieve that.
However, that specific situation triggered a warning. This commit prevents it
for the specific case of an invalid hidden service port.
Fixes #16706
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index a7a5071198..5139036327 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -257,8 +257,13 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, log_debug(LD_OR,"Sending to origin."); if ((reason = connection_edge_process_relay_cell(cell, circ, conn, layer_hint)) < 0) { - log_warn(LD_OR, - "connection_edge_process_relay_cell (at origin) failed."); + /* If a client is trying to connect to unknown hidden service port, + * END_CIRC_AT_ORIGIN is sent back so we can then close the circuit. + * Do not log warn as this is an expected behavior for a service. */ + if (reason != END_CIRC_AT_ORIGIN) { + log_warn(LD_OR, + "connection_edge_process_relay_cell (at origin) failed."); + } return reason; } } |