aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index be0c9a482..ab8358414 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1030,9 +1030,19 @@ addressmap_register_virtual_address(int type, char *new_address)
static int
address_is_invalid_destination(const char *address)
{
- /* FFFF should flesh this out */
- if (strchr(address,':'))
- return 1;
+ if (get_options()->AllowNonRFC953Hostnames)
+ return 0;
+
+ while (*address) {
+ if (TOR_ISALNUM(*address) ||
+ *address == '-' ||
+ *address == '.' ||
+ *address == '_') /* Underscore is not allowed, but Windows does it
+ * sometimes, just to thumb its nose at the IETF. */
+ ++address;
+ else
+ return 1;
+ }
return 0;
}