diff options
author | Linus Nordberg <linus@nordberg.se> | 2012-05-10 17:08:22 +0200 |
---|---|---|
committer | Linus Nordberg <linus@torproject.org> | 2012-07-19 18:21:21 +0200 |
commit | 6d99c51f15d664ff6b33957b1043c73448a72711 (patch) | |
tree | 044c08b6ea3add95d2b833bae2a8a0404de91dbf /src | |
parent | dda177b19e614c866d67a02aab1c0a83ca22760d (diff) | |
download | tor-6d99c51f15d664ff6b33957b1043c73448a72711.tar tor-6d99c51f15d664ff6b33957b1043c73448a72711.tar.gz |
Don't put unreachable IPv6 OR port in routerstatus.
To have only reachable ports in "a" lines.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/dirserv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 2af4e688c..abbc123f9 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2468,8 +2468,14 @@ 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; - tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr); - rs->ipv6_orport = ri->ipv6_orport; + if (!tor_addr_is_null(&ri->ipv6_addr) && + node->last_reachable6 >= now - REACHABLE_TIMEOUT) { + /* There's an IPv6 OR port and it's reachable so copy it to the + routerstatus. FIXME: If we're not on IPv6, copy it regardless + of reachability. */ + tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr); + rs->ipv6_orport = ri->ipv6_orport; + } } /** Routerstatus <b>rs</b> is part of a group of routers that are on |