summaryrefslogtreecommitdiff
path: root/src/or/routerset.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-09-14 20:01:36 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2015-09-14 20:01:36 +1000
commitc58b3726d6a6ab8990ec745702c21a5bb6f4a9c0 (patch)
tree24afde9199dcf4b79593339107ff90f951cffac1 /src/or/routerset.c
parenta444b11323799536b4cd7902e29f711b0806293a (diff)
downloadtor-c58b3726d6a6ab8990ec745702c21a5bb6f4a9c0.tar.gz
tor-c58b3726d6a6ab8990ec745702c21a5bb6f4a9c0.zip
Allow IPv6 literal addresses in routersets
routerset_parse now accepts IPv6 literal addresses. Fix for ticket 17060. Patch by "teor". Patch on 3ce6e2fba290 (24 Jul 2008), and related commits, released in 0.2.1.3-alpha.
Diffstat (limited to 'src/or/routerset.c')
-rw-r--r--src/or/routerset.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/routerset.c b/src/or/routerset.c
index 9fe5dffdeb..6a93a327ee 100644
--- a/src/or/routerset.c
+++ b/src/or/routerset.c
@@ -104,9 +104,11 @@ routerset_parse(routerset_t *target, const char *s, const char *description)
description);
smartlist_add(target->country_names, countryname);
added_countries = 1;
- } else if ((strchr(nick,'.') || strchr(nick, '*')) &&
- (p = router_parse_addr_policy_item_from_string(
- nick, ADDR_POLICY_REJECT))) {
+ } else if ((strchr(nick,'.') || strchr(nick, ':') || strchr(nick, '*'))
+ && (p = router_parse_addr_policy_item_from_string(
+ nick, ADDR_POLICY_REJECT))) {
+ /* IPv4 addresses contain '.', IPv6 addresses contain ':',
+ * and wildcard addresses contain '*'. */
log_debug(LD_CONFIG, "Adding address %s to %s", nick, description);
smartlist_add(target->policies, p);
} else {