diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-08-17 12:39:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-08-17 12:39:31 -0400 |
commit | eec86939d13681b3b6560caf6c49ec1b55c2489b (patch) | |
tree | 4502387d1d472fc3d853bafce284664725ccb1a5 /src/or/control.c | |
parent | 1728801bbc42f45e561812d8655b7f46fc740ea8 (diff) | |
parent | e9172e51fb13cfe5d4c70a98809a45e05b528482 (diff) | |
download | tor-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.c | 15 |
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 " |