]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make set_routerstatus_from_routerinfo() set IPv6 unspecified addresses
authorteor <teor2345@gmail.com>
Sun, 15 Oct 2017 18:36:06 +0000 (14:36 -0400)
committerteor <teor2345@gmail.com>
Sat, 2 Dec 2017 10:00:22 +0000 (21:00 +1100)
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.

changes/bug24488 [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/bug24488 b/changes/bug24488
new file mode 100644 (file)
index 0000000..b8094e2
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (directory authorities, IPv6):
+    - 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. Fixes bug 24488; bugfix on 0.2.4.1-alpha.
index 432fe6ae2b0e0bdf31580d70f88a8d6a720a1cc3..19d2541b077f5e2d6a0b8009503420a127b38855 100644 (file)
@@ -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) {