[tor-commits] [tor/maint-0.2.3] Don't include a router in an md consensus if we can't find a md for it.

nickm at torproject.org nickm at torproject.org
Tue Aug 21 14:43:31 UTC 2012


commit 7143d112a69806bde4a29bf8da94704cfb435fe3
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Jul 31 10:54:14 2012 -0400

    Don't include a router in an md consensus if we can't find a md for it.
    
    The spec requires that every router in a microdesc consensus have an
    m line; we weren't obeying that spec.
    
    This creates a new consensus method (13) to allow voting to continue
    to work right. Partial fix for bug 6404; fix on 0.2.2.6-alpha.
---
 changes/bug6404  |    5 +++++
 src/or/dirvote.c |   13 ++++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/changes/bug6404 b/changes/bug6404
index d01964d..64d4594 100644
--- a/changes/bug6404
+++ b/changes/bug6404
@@ -5,3 +5,8 @@
       with complex policies or family declarations. Partial fix for
       bug 6404; fix on 0.2.2.6-alpha.
 
+    - Authorities no longer include any router in their
+      microdescriptor consensuses for which they couldn't generate or
+      agree on a microdescriptor.  Partial fix for bug 6404; fix on
+      0.2.2.6-alpha.
+
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 85ea85c..87af5be 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -54,7 +54,7 @@ static int dirvote_publish_consensus(void);
 static char *make_consensus_method_list(int low, int high, const char *sep);
 
 /** The highest consensus method that we currently support. */
-#define MAX_SUPPORTED_CONSENSUS_METHOD 12
+#define MAX_SUPPORTED_CONSENSUS_METHOD 13
 
 /** Lowest consensus method that contains a 'directory-footer' marker */
 #define MIN_METHOD_FOR_FOOTER 9
@@ -72,6 +72,10 @@ static char *make_consensus_method_list(int low, int high, const char *sep);
   * for a param. */
 #define MIN_METHOD_FOR_MAJORITY_PARAMS 12
 
+/** Lowest consensus method where microdesc consensuses omit any entry
+ * with no microdesc. */
+#define MIN_METHOD_FOR_MANDATORY_MICRODESC 13
+
 /* =====
  * Voting
  * =====*/
@@ -1935,6 +1939,13 @@ networkstatus_compute_consensus(smartlist_t *votes,
         }
       }
 
+      if (flavor == FLAV_MICRODESC &&
+          consensus_method >= MIN_METHOD_FOR_MANDATORY_MICRODESC &&
+          tor_digest256_is_zero(microdesc_digest)) {
+        /* With no microdescriptor digest, we omit the entry entirely. */
+        continue;
+      }
+
       {
         char buf[4096];
         /* Okay!! Now we can write the descriptor... */





More information about the tor-commits mailing list