diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-06-27 23:55:01 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-06-27 23:55:01 -0400 |
commit | 28c42fe029a2a6029b17cc35821d82ba2b9bf318 (patch) | |
tree | fe4c58efa6ed79318a505b25b17deb1ee07e8540 /src | |
parent | 23f2e37ff75ef539cc5634e3f48f9a86cb95a2d9 (diff) | |
download | tor-28c42fe029a2a6029b17cc35821d82ba2b9bf318.tar tor-28c42fe029a2a6029b17cc35821d82ba2b9bf318.tar.gz |
Fix GETINFO address-mappings/... with wildcarded addresses.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 98920781a..3c8b4bcc9 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1702,17 +1702,22 @@ addressmap_get_mappings(smartlist_t *sl, time_t min_expires, addressmap_ent_remove(key, val); continue; } else if (val->new_address) { + const char *src_wc = val->src_wildcard ? "*." : ""; + const char *dst_wc = val->dst_wildcard ? "*." : ""; if (want_expiry) { if (val->expires < 3 || val->expires == TIME_MAX) - smartlist_add_asprintf(sl, "%s %s NEVER", key, val->new_address); + smartlist_add_asprintf(sl, "%s%s %s%s NEVER", + src_wc, key, dst_wc, val->new_address); else { char time[ISO_TIME_LEN+1]; format_iso_time(time, val->expires); - smartlist_add_asprintf(sl, "%s %s \"%s\"", key, val->new_address, - time); + smartlist_add_asprintf(sl, "%s%s %s%s \"%s\"", + src_wc, key, dst_wc, val->new_address, + time); } } else { - smartlist_add_asprintf(sl, "%s %s", key, val->new_address); + smartlist_add_asprintf(sl, "%s%s %s%s", + src_wc, key, dst_wc, val->new_address); } } } |