summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-09-08 11:54:24 -0400
committerNick Mathewson <nickm@torproject.org>2011-11-30 14:08:11 -0500
commit69d16900aaf1d54b44d2b28514a09873154c63d3 (patch)
treedae8d76b14f99e94af2291fab286dc47100a5710 /src/or/control.c
parentdf0da3991cb00efdf7c9362e805877e63ce8a46e (diff)
downloadtor-69d16900aaf1d54b44d2b28514a09873154c63d3.tar.gz
tor-69d16900aaf1d54b44d2b28514a09873154c63d3.zip
Refactor addressmap_match_superdomains and representation of wildcards
In this new representation for wildcarded addresses, there are no longer any 'magic addresses': rather, "a.b c.d", "*.a.b c.d" and "*.a.b *.c.d" are all represented by a mapping from "a.b" to "c.d". we now distinguish them by setting bits in the addressmap_entry_t structure, where src_wildcard is set if the source address had a wildcard, and dst_wildcard is set if the target address had a wildcard. This lets the case where "*.a.b *.c.d" or "*.a.b c.d" remap the address "a.b" get handled trivially, and lets us simplify and improve the addressmap_match_superdomains implementation: we can now have it run in O(parts of address) rather than O(entries in addressmap).
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c
index f852659983..ce37aca5a6 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1331,7 +1331,7 @@ handle_control_mapaddress(control_connection_t *conn, uint32_t len,
smartlist_add(reply, ans);
}
} else {
- addressmap_register(from, tor_strdup(to), 1, ADDRMAPSRC_CONTROLLER);
+ addressmap_register(from, tor_strdup(to), 1, ADDRMAPSRC_CONTROLLER,0,0);
tor_snprintf(ans, anslen, "250-%s", line);
smartlist_add(reply, ans);
}