[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Authorities put p6 lines into microdescriptors.



commit 04ea55014182776871841279f6917d1a03c4e905
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Oct 24 22:34:55 2012 -0400

    Authorities put p6 lines into microdescriptors.
---
 src/or/dirvote.c |   11 +++++++++++
 src/or/dirvote.h |    5 ++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index f8b8d37..9810c82 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3569,6 +3569,17 @@ dirvote_create_microdescriptor(const routerinfo_t *ri, int consensus_method)
   if (summary && strcmp(summary, "reject 1-65535"))
     smartlist_add_asprintf(chunks, "p %s\n", summary);
 
+  if (consensus_method >= MIN_METHOD_FOR_P6_LINES &&
+      ri->ipv6_exit_policy) {
+    /* XXXX024 This doesn't match proposal 208, which says these should
+     * be taken unchanged from the routerinfo.  That's bogosity, IMO:
+     * the proposal should have said to do this instead.*/
+    char *p6 = write_short_policy(ri->ipv6_exit_policy);
+    if (p6 && strcmp(p6, "reject 1-65535"))
+      smartlist_add_asprintf(chunks, "p6 %s\n", p6);
+    tor_free(p6);
+  }
+
   output = smartlist_join_strings(chunks, "", 0, NULL);
 
   {
diff --git a/src/or/dirvote.h b/src/or/dirvote.h
index 04cf2f9..d14a375 100644
--- a/src/or/dirvote.h
+++ b/src/or/dirvote.h
@@ -20,7 +20,7 @@
 #define MIN_VOTE_INTERVAL 300
 
 /** The highest consensus method that we currently support. */
-#define MAX_SUPPORTED_CONSENSUS_METHOD 14
+#define MAX_SUPPORTED_CONSENSUS_METHOD 15
 
 /** Lowest consensus method that contains a 'directory-footer' marker */
 #define MIN_METHOD_FOR_FOOTER 9
@@ -45,6 +45,9 @@
 /** Lowest consensus method that contains "a" lines. */
 #define MIN_METHOD_FOR_A_LINES 14
 
+/** Lowest consensus method where microdescs may include a "p6" line. */
+#define MIN_METHOD_FOR_P6_LINES 15
+
 void dirvote_free_all(void);
 
 /* vote manipulation */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits