]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
cell: Do not warn on hidden service invalid port
authorDavid Goulet <dgoulet@torproject.org>
Wed, 5 Apr 2017 20:28:37 +0000 (16:28 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Wed, 5 Apr 2017 20:28:37 +0000 (16:28 -0400)
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>
changes/bug16706 [new file with mode: 0644]
src/or/relay.c

diff --git a/changes/bug16706 b/changes/bug16706
new file mode 100644 (file)
index 0000000..9c1e315
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (hidden service):
+    - Stop printing cryptic warning when a client tries to connect on an
+      invalid port of the service. Fixes #16706.; bugfix on tor-0.2.6.3-alpha.
index a7a507119855141e19603cfef6f9e87fd0fdee45..5139036327a536b0d8e678e9cf9ba9ed69acd7ec 100644 (file)
@@ -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;
       }
     }