[tor-commits] [tor/master] Warn on ExtORPort USERADDR that is missing or 0.
nickm at torproject.org
nickm at torproject.org
Wed Sep 20 16:12:17 UTC 2017
commit c4e8548c59c1eb423fe6a39f2712dbc1eff3951a
Author: Nick Mathewson <nickm at torproject.org>
Date: Wed Sep 20 08:50:49 2017 -0400
Warn on ExtORPort USERADDR that is missing or 0.
Diagnoses violations on #23080.
---
changes/bug23080 | 5 +++++
src/or/ext_orport.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/changes/bug23080 b/changes/bug23080
new file mode 100644
index 000000000..c80d323d3
--- /dev/null
+++ b/changes/bug23080
@@ -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.
diff --git a/src/or/ext_orport.c b/src/or/ext_orport.c
index c22a2f13d..28377a3f3 100644
--- a/src/or/ext_orport.c
+++ b/src/or/ext_orport.c
@@ -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);
More information about the tor-commits
mailing list