diff options
author | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-03-01 16:41:52 +0100 |
---|---|---|
committer | teor (Tim Wilson-Brown) <teor2345@gmail.com> | 2016-03-01 16:48:16 +0100 |
commit | 2120e140093484725ccb7221fa117e2c18795c4b (patch) | |
tree | 03d4759f2dc22048d84dde9d9a398cf6f93650f8 /src/or/router.c | |
parent | 9fc472e1a8a53a18dfbd5c9cde2f1c268c335e96 (diff) | |
download | tor-2120e140093484725ccb7221fa117e2c18795c4b.tar.gz tor-2120e140093484725ccb7221fa117e2c18795c4b.zip |
Allow internal IPv6 addresses in descriptors in private networks
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index 80732c9036..60b03c0b54 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1941,7 +1941,11 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e) ! p->server_cfg.no_advertise && ! p->server_cfg.bind_ipv4_only && tor_addr_family(&p->addr) == AF_INET6) { - if (! tor_addr_is_internal(&p->addr, 0)) { + /* Like IPv4, if the relay is configured using the default + * authorities, disallow internal IPs. Otherwise, allow them. */ + const int default_auth = (!options->DirAuthorities && + !options->AlternateDirAuthority); + if (! tor_addr_is_internal(&p->addr, 0) || ! default_auth) { ipv6_orport = p; break; } else { |