소스 검색

Merge branch 'tor-github/pr/698'

George Kadianakis 5 년 전
부모
커밋
57d33b5786
2개의 변경된 파일19개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 0
      changes/bug24338
  2. 15 3
      src/feature/dirauth/voteflags.c

+ 4 - 0
changes/bug24338

@@ -0,0 +1,4 @@
+  o Minor bugfixes (dirauth, ipv6):
+    - If we are a durauth with IPv6 and are marking relays as running, mark
+      ourselves as reachable on IPv6. Fixes bug 24338; bugfix on 0.4.0.2-alpha.
+      Patch by Neel Chauhan

+ 15 - 3
src/feature/dirauth/voteflags.c

@@ -531,6 +531,20 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now)
   node->is_running = answer;
 }
 
+/* Check <b>node</b> and <b>ri</b> on whether or not we should publish a
+ * relay's IPv6 addresses. */
+static int
+should_publish_node_ipv6(const node_t *node, const routerinfo_t *ri,
+                         time_t now)
+{
+  const or_options_t *options = get_options();
+
+  return options->AuthDirHasIPv6Connectivity == 1 &&
+    !tor_addr_is_null(&ri->ipv6_addr) &&
+    ((node->last_reachable6 >= now - REACHABLE_TIMEOUT) ||
+     router_is_me(ri));
+}
+
 /** Extract status information from <b>ri</b> and from other authority
  * functions and store it in <b>rs</b>. <b>rs</b> is zeroed out before it is
  * set.
@@ -597,9 +611,7 @@ set_routerstatus_from_routerinfo(routerstatus_t *rs,
   rs->is_staledesc =
     (ri->cache_info.published_on + DESC_IS_STALE_INTERVAL) < now;
 
-  if (options->AuthDirHasIPv6Connectivity == 1 &&
-      !tor_addr_is_null(&ri->ipv6_addr) &&
-      node->last_reachable6 >= now - REACHABLE_TIMEOUT) {
+  if (should_publish_node_ipv6(node, ri, now)) {
     /* We're configured as having IPv6 connectivity. There's an IPv6
        OR port and it's reachable so copy it to the routerstatus.  */
     tor_addr_copy(&rs->ipv6_addr, &ri->ipv6_addr);