]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Warn on ExtORPort USERADDR that is missing or 0.
authorNick Mathewson <nickm@torproject.org>
Wed, 20 Sep 2017 12:50:49 +0000 (08:50 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 20 Sep 2017 12:50:49 +0000 (08:50 -0400)
Diagnoses violations on #23080.

changes/bug23080 [new file with mode: 0644]
src/or/ext_orport.c

diff --git a/changes/bug23080 b/changes/bug23080
new file mode 100644 (file)
index 0000000..c80d323
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor features (spec conformance, bridge, diagnostic):
+    - When handling the USERADDR command on an ExtOrPort, warn when the
+      transports provides a USERADDR with no port. In a future version,
+      USERADDR commands of this format may be rejected. Detects problems
+      related to ticket 23080.
index c22a2f13d8af29d07598db7fe31698af72e8aade..28377a3f36cce1ccf429dfe08efc690c2a4aa3e1 100644 (file)
@@ -460,6 +460,11 @@ connection_ext_or_handle_cmd_useraddr(connection_t *conn,
   tor_free(addr_str);
   if (res<0)
     return -1;
+  if (port == 0) {
+    log_warn(LD_GENERAL, "Server transport proxy gave us an empty port "
+             "in ExtORPort UserAddr command.");
+    // return -1; // enable this if nothing breaks after a while.
+  }
 
   res = tor_addr_parse(&addr, address_part);
   tor_free(address_part);