diff options
author | Linus Nordberg <linus@torproject.org> | 2012-07-19 23:23:22 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-07-19 17:51:15 -0400 |
commit | fff842a47c7aca7cc8d49ac0e487fa3c6a536c96 (patch) | |
tree | 886e6688a318744ba4d1679d33012f59784a1953 /src | |
parent | 6208106c18c696756fe2be8f941992e31aa66a8d (diff) | |
download | tor-fff842a47c7aca7cc8d49ac0e487fa3c6a536c96.tar.gz tor-fff842a47c7aca7cc8d49ac0e487fa3c6a536c96.zip |
Add config option AuthDirPublishIPv6.
Test for config option AuthDirPublishIPv6 == 1 rather than for running
as a bridge authority when deciding whether to care or not about IPv6
OR ports in descriptors.
Implements enhancement #6406.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/config.c | 1 | ||||
-rw-r--r-- | src/or/dirserv.c | 9 | ||||
-rw-r--r-- | src/or/or.h | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/or/config.c b/src/or/config.c index 87c9cc4bb7..1a378c2271 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -202,6 +202,7 @@ static config_var_t _option_vars[] = { V(AuthDirMaxServersPerAddr, UINT, "2"), V(AuthDirMaxServersPerAuthAddr,UINT, "5"), V(AuthDirHasIPv6Connectivity, AUTOBOOL, "auto"), + V(AuthDirPublishIPv6, BOOL, "0"), VAR("AuthoritativeDirectory", BOOL, AuthoritativeDir, "0"), V(AutomapHostsOnResolve, BOOL, "0"), V(AutomapHostsSuffixes, CSV, ".onion,.exit"), diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 7020d5b2a3..d12ed8a811 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2468,14 +2468,13 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs, strlcpy(rs->nickname, ri->nickname, sizeof(rs->nickname)); rs->or_port = ri->or_port; rs->dir_port = ri->dir_port; - if (authdir_mode_bridge(options) && + if (options->AuthDirPublishIPv6 == 1 && !tor_addr_is_null(&ri->ipv6_addr) && (options->AuthDirHasIPv6Connectivity == 0 || node->last_reachable6 >= now - REACHABLE_TIMEOUT)) { - /* We're a bridge authority (we're not ready for IPv6 relays in - the consensus quite yet). There's an IPv6 OR port and it's - reachable (or we know that we're not on IPv6) so copy it to the - routerstatus. */ + /* We're configured for publishing IPv6 OR ports. There's an IPv6 + OR port and it's reachable (or we know that we're not on IPv6) + so copy it to the routerstatus. */ tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr); rs->ipv6_orport = ri->ipv6_orport; } diff --git a/src/or/or.h b/src/or/or.h index 9474c00fae..b6cffd4bea 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3274,6 +3274,7 @@ typedef struct { * number of servers per IP address shared * with an authority. */ int AuthDirHasIPv6Connectivity; /**< Autoboolean: are we on IPv6? */ + int AuthDirPublishIPv6; /**< Boolean: should we list IPv6 OR ports? */ /** If non-zero, always vote the Fast flag for any relay advertising * this amount of capacity or more. */ |