]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Ignore [::] when building descriptors.
authorLinus Nordberg <linus@nordberg.se>
Thu, 3 May 2012 20:19:38 +0000 (22:19 +0200)
committerLinus Nordberg <linus@nordberg.se>
Thu, 3 May 2012 20:19:38 +0000 (22:19 +0200)
This is how IPv6 says "0.0.0.0" and something we will have to
translate into a globally reachable address before putting it in a
descriptor.

The fix is a short term solution until a real one is implemented.

Closes #5146.

src/or/router.c

index 4cdfd02e566b1d10e26bdd5d7dc92d54a7b30952..c51bb5dc4db2067ce8a93c5620e95a2b3ca0c8a0 100644 (file)
@@ -1530,10 +1530,18 @@ router_rebuild_descriptor(int force)
       if (p->type == CONN_TYPE_OR_LISTENER &&
           ! p->no_advertise &&
           ! p->ipv4_only &&
-          tor_addr_family(&p->addr) == AF_INET6 &&
-          ! tor_addr_is_internal(&p->addr, 1)) {
-        ipv6_orport = p;
-        break;
+          tor_addr_family(&p->addr) == AF_INET6) {
+        if (! tor_addr_is_internal(&p->addr, 0)) {
+          ipv6_orport = p;
+          break;
+        } else {
+          char addrbuf[TOR_ADDR_BUF_LEN];
+          log_warn(LD_CONFIG,
+                   "Unable to use configured IPv6 address \"%s\" in a "
+                   "descriptor. Skipping it. "
+                   "Try specifying a globally reachable address explicitly. ",
+                   tor_addr_to_str(addrbuf, &p->addr, sizeof(addrbuf), 1));
+        }
       }
     } SMARTLIST_FOREACH_END(p);
     if (ipv6_orport) {