aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2012-05-03 22:19:38 +0200
committerLinus Nordberg <linus@nordberg.se>2012-05-03 22:19:38 +0200
commit6b4af1071668028b367f185121688758988ff489 (patch)
tree8d4ee4c93c7c900a3f3abc5b272323519c2ae3c2 /src/or
parentc9afd6f9c5a3cf73340e528818570b4ba5cdf6b2 (diff)
downloadtor-6b4af1071668028b367f185121688758988ff489.tar
tor-6b4af1071668028b367f185121688758988ff489.tar.gz
Ignore [::] when building descriptors.
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.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/router.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 4cdfd02e5..c51bb5dc4 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -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) {