From 5f8e2c2bc42239e9347ef70f3775c0d4ad378e1c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 2 Mar 2005 21:02:11 +0000 Subject: 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 --- src/or/control.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/or/control.c') 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 { -- cgit v1.2.3-54-g00ecf