]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Allow IPv6 literal addresses in routersets
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Mon, 14 Sep 2015 10:01:36 +0000 (20:01 +1000)
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>
Mon, 14 Sep 2015 10:01:36 +0000 (20:01 +1000)
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.

changes/routerset-parse-IPv6-literals [new file with mode: 0644]
src/or/routerset.c

diff --git a/changes/routerset-parse-IPv6-literals b/changes/routerset-parse-IPv6-literals
new file mode 100644 (file)
index 0000000..c80c82c
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bug fixes (routersets, IPv6):
+    - 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.
index 9fe5dffdeb88cb0786fdbc9cef94a5ccb6a4e69c..6a93a327eea7622f3523a6f2c0b0bf585a91245c 100644 (file)
@@ -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 {