[tor-commits] [atlas/master] Adds unreachable OR address information (Fixes: #24388)

irl at torproject.org irl at torproject.org
Sun Dec 17 19:25:02 UTC 2017


commit 6643de6428e8604674d069a16c62db8456572ef1
Author: Iain R. Learmonth <irl at fsfe.org>
Date:   Sun Dec 17 19:05:38 2017 +0000

    Adds unreachable OR address information (Fixes: #24388)
    
     * A list of unreachable OR addresses is displayed in the details view
       for relays
     * An UnreachableIPv4 flag will be synthesised when an IPv4 address is
       listed by Onionoo as unreachable
     * An UnreachableIPv6 flag will be synthesised when an IPv6 address is
       listed by Onionoo as unreachable
---
 js/models/relay.js            | 13 ++++++++++++-
 templates/details/router.html | 12 +++++++++++-
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/js/models/relay.js b/js/models/relay.js
index 813030d..d796cd7 100644
--- a/js/models/relay.js
+++ b/js/models/relay.js
@@ -65,7 +65,13 @@ define([
                     output.push([flag,"fallbackdir", "Tor clients contact fallback directory mirrors during bootstrap, and download the consensus and authority certificates from them. We include a default list of mirrors in the Tor source code. These default mirrors need to be long-term stable, and on the same IPv4 and IPv6 addresses and ports."]);
                 }
                 if (flag == "ReachableIPv6") {
-                    output.push([flag,"reachableipv6", "This relay accepts OR connections using IPv6."]);
+                    output.push([flag,"reachableipv6", "This relay claims to accept OR connections using IPv6 and the directory authorities have confirmed it is reachable."]);
+                }
+                if (flag == "UnreachableIPv6") {
+                    output.push([flag,"unreachableipv6", "This relay claims to accept OR connections using IPv6 but the directory authorities failed to confirm it was reachable."]);
+                }
+                if (flag == "UnreachableIPv4") {
+                    output.push([flag,"unreachableipv4", "This relay claims to accept OR connections using IPv4 but the directory authorities failed to confirm it was reachable."]);
                 }
                 if (flag == "IPv6 Exit") {
                     output.push([flag, "ipv6exit", "This relay allows exit connections using IPv6."]);
@@ -195,7 +201,10 @@ define([
                         relay.or_addresses = new_addresses;
                     }
                     relay.or_address = relay.or_addresses ? relay.or_addresses[0].split(":")[0] : null;
+                    relay.unreachable_or_addresses = relay.unreachable_or_addresses ? relay.unreachable_or_addresses : [];
                     relay.or_v6_addresses = $.grep(relay.or_addresses, function(n, i) { return n.indexOf("[") == 0; });
+                    relay.unreachable_or_v4_addresses = $.grep(relay.unreachable_or_addresses, function(n, i) { return n.indexOf(".") != -1; });
+                    relay.unreachable_or_v6_addresses = $.grep(relay.unreachable_or_addresses, function(n, i) { return n.indexOf("[") == 0; });
                     relay.or_port = relay.or_addresses ? relay.or_addresses[0].split(":")[1] : 0;
                     relay.dir_port = relay.dir_address ? relay.dir_address.split(":")[1] : 0;
                     relay.exit_addresses = relay.exit_addresses ? relay.exit_addresses : null;
@@ -225,6 +234,8 @@ define([
                     if (!((typeof relay.measured !== 'undefined') ? relay.measured : true)) additional_flags.push("Unmeasured");
                     if (IsFallbackDir(relay.fingerprint)) additional_flags.push("FallbackDir");
                     if (relay.or_v6_addresses.length > 0) additional_flags.push("ReachableIPv6");
+                    if (relay.unreachable_or_v4_addresses.length > 0) additional_flags.push("UnreachableIPv4");
+                    if (relay.unreachable_or_v6_addresses.length > 0) additional_flags.push("UnreachableIPv6");
                     if (relay.exit_policy_v6_summary !== null) additional_flags.push("IPv6 Exit");
 
                     relay.additional_flags = model.parseadditionalflags(additional_flags);
diff --git a/templates/details/router.html b/templates/details/router.html
index b92d6ad..ddd0c77 100644
--- a/templates/details/router.html
+++ b/templates/details/router.html
@@ -21,7 +21,17 @@
       <dd><%= _.escape(relay.get('nickname')) %></dd>
 
       <dt><span class="tip" title="Addresses and ports where the relay listens for incoming connections from clients and other relays.">OR Addresses</span> <a href="#search/<%= relay.get('or_addresses')[0].split(":")[0] %>"><i class="fa fa-search"></i></a></dt>
-      <dd><%= relay.get('or_addresses') %></dd>
+      <dd>
+        <pre class="pre-scrollable"><% _.each(relay.get('or_addresses'),
+          function(or_address) { %><%= $.trim(or_address) %><br><% }); %></pre>
+      </dd>
+      <% if (relay.get('unreachable_or_addresses').length > 0) { %>
+      <dt><span class="tip" title="Addresses and ports where the relay claims to listen for incoming connections from clients and other relays but that the directory authorities failed to confirm as reachable.">Unreachable OR Addresses</span></dt>
+      <dd>
+        <pre class="pre-scrollable"><% _.each(relay.get('unreachable_or_addresses'),
+          function(or_address) { %><%= $.trim(or_address) %><br><% }); %></pre>
+      </dd>
+      <% } %>
 
       <dt><span class="tip" title="These are the contact details of the Tor relay operator">Contact</span></dt>
       <dd><%= _.escape( relay.get('contact')!='undefined' ? relay.get('contact') : 'none' ) %></dd>





More information about the tor-commits mailing list