aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-08-17 12:39:31 -0400
committerNick Mathewson <nickm@torproject.org>2012-08-17 12:39:31 -0400
commiteec86939d13681b3b6560caf6c49ec1b55c2489b (patch)
tree4502387d1d472fc3d853bafce284664725ccb1a5 /src/or/control.c
parent1728801bbc42f45e561812d8655b7f46fc740ea8 (diff)
parente9172e51fb13cfe5d4c70a98809a45e05b528482 (diff)
downloadtor-eec86939d13681b3b6560caf6c49ec1b55c2489b.tar.gz
tor-eec86939d13681b3b6560caf6c49ec1b55c2489b.zip
Merge remote-tracking branch 'origin/maint-0.2.3'
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 61a9f724e0..4a0f8d70a1 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1380,9 +1380,18 @@ handle_control_mapaddress(control_connection_t *conn, uint32_t len,
smartlist_add_asprintf(reply, "250-%s=%s", address, to);
}
} else {
- addressmap_register(from, tor_strdup(to), 1,
- ADDRMAPSRC_CONTROLLER, 0, 0);
- smartlist_add_asprintf(reply, "250-%s", line);
+ const char *msg;
+ if (addressmap_register_auto(from, to, 1,
+ ADDRMAPSRC_CONTROLLER, &msg) < 0) {
+ smartlist_add_asprintf(reply,
+ "512-syntax error: invalid address mapping "
+ " '%s': %s", line, msg);
+ log_warn(LD_CONTROL,
+ "Skipping invalid argument '%s' in MapAddress msg: %s",
+ line, msg);
+ } else {
+ smartlist_add_asprintf(reply, "250-%s", line);
+ }
}
} else {
smartlist_add_asprintf(reply, "512-syntax error: mapping '%s' is "