aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-03-02 21:02:11 +0000
committerNick Mathewson <nickm@torproject.org>2005-03-02 21:02:11 +0000
commit5f8e2c2bc42239e9347ef70f3775c0d4ad378e1c (patch)
tree01e145de5a76afd5f96e1551c9e531bc0cd92637 /src/or/control.c
parentfc0e67bc7241d0a439ee73747c373d7ed2af4b01 (diff)
downloadtor-5f8e2c2bc42239e9347ef70f3775c0d4ad378e1c.tar.gz
tor-5f8e2c2bc42239e9347ef70f3775c0d4ad378e1c.zip
Rename unused-address functions to virtual address; this is more accurate. Also, include almost-right implementation of reusing dont-care mappings. (It is still kind of wrong because it does not take type into account.)
svn:r3728
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 4714e8ee7a..789cdc8898 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -496,8 +496,9 @@ handle_control_mapaddress(connection_t *conn, uint32_t len, const char *body)
} else if (!is_plausible_address(to)) {
log_fn(LOG_WARN,"Skipping invalid argument '%s' in AddressMap msg",to);
} else if (!strcmp(from, ".") || !strcmp(from, "0.0.0.0")) {
- char *addr = client_dns_get_unmapped_address(
- strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4);
+ char *addr = addressmap_register_virtual_address(
+ strcmp(from,".") ? RESOLVED_TYPE_HOSTNAME : RESOLVED_TYPE_IPV4,
+ tor_strdup(to));
if (!addr) {
log_fn(LOG_WARN,
"Unable to allocate address for '%s' in AdressMap msg", line);
@@ -505,7 +506,7 @@ handle_control_mapaddress(connection_t *conn, uint32_t len, const char *body)
size_t anslen = strlen(addr)+strlen(to)+2;
char *ans = tor_malloc(anslen);
tor_snprintf(ans, anslen, "%s %s", addr, to);
- addressmap_register(addr, tor_strdup(to), 0);
+ tor_free(addr);
smartlist_add(reply, ans);
}
} else {