summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-10-15 14:36:06 -0400
committerteor <teor2345@gmail.com>2017-12-02 21:00:22 +1100
commitf1a5000b98c4f0e5ee1618165bde533aaff0fd79 (patch)
tree2e1ee81640893252464e301992003a3874f88364 /src/or/dirserv.c
parentcf3da63b9023875e93c05d30fb6d76e047bebe70 (diff)
downloadtor-f1a5000b98c4f0e5ee1618165bde533aaff0fd79.tar.gz
tor-f1a5000b98c4f0e5ee1618165bde533aaff0fd79.zip
Make set_routerstatus_from_routerinfo() set IPv6 unspecified addresses
When creating a routerstatus (vote) from a routerinfo (descriptor), set the IPv6 address to the unspecified IPv6 address, and explicitly initialise the port to zero. Also clarify the documentation for the function. Fixes bug 24488; bugfix on 0.2.4.1-alpha.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index 432fe6ae2b..19d2541b07 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2219,7 +2219,8 @@ routers_make_ed_keys_unique(smartlist_t *routers)
}
/** Extract status information from <b>ri</b> and from other authority
- * functions and store it in <b>rs</b>>.
+ * functions and store it in <b>rs</b>. <b>rs</b> is zeroed out before it is
+ * set.
*
* We assume that ri-\>is_running has already been set, e.g. by
* dirserv_set_router_is_running(ri, now);
@@ -2285,6 +2286,9 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
OR port and it's reachable so copy it to the routerstatus. */
tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr);
rs->ipv6_orport = ri->ipv6_orport;
+ } else {
+ tor_addr_make_null(&rs->ipv6_addr, AF_INET6);
+ rs->ipv6_orport = 0;
}
if (options->TestingTorNetwork) {