[tor-commits] [tor/maint-0.2.2] bug 3026: do not upload our vote to ourself

nickm at torproject.org nickm at torproject.org
Sun May 15 16:17:25 UTC 2011


commit 6b83b3ba2aff4ba815241c76d712d149f13465e1
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu May 12 00:47:00 2011 -0400

    bug 3026: do not upload our vote to ourself
---
 changes/bug3026    |    4 ++++
 src/or/directory.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/changes/bug3026 b/changes/bug3026
new file mode 100644
index 0000000..c0c0a38
--- /dev/null
+++ b/changes/bug3026
@@ -0,0 +1,4 @@
+  o Minor bugfixes (directory authority)
+    - Do not upload our own vote or signature set to ourself.  It would
+      tell us nothing new.  Also, as of Tor 0.2.2.24-alpha, we started
+      to warn about receiving duplicate votes.  Resolves bug 3026.
diff --git a/src/or/directory.c b/src/or/directory.c
index 8c6581a..86dcc8d 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -279,6 +279,8 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
   int post_via_tor;
   smartlist_t *dirservers = router_get_trusted_dir_servers();
   int found = 0;
+  const int exclude_self = (dir_purpose == DIR_PURPOSE_UPLOAD_VOTE ||
+                            dir_purpose == DIR_PURPOSE_UPLOAD_SIGNATURES);
   tor_assert(dirservers);
   /* This tries dirservers which we believe to be down, but ultimately, that's
    * harmless, and we may as well err on the side of getting things uploaded.
@@ -291,6 +293,9 @@ directory_post_to_dirservers(uint8_t dir_purpose, uint8_t router_purpose,
       if ((type & ds->type) == 0)
         continue;
 
+      if (exclude_self && router_digest_is_me(ds->digest))
+        continue;
+
       if (options->ExcludeNodes && options->StrictNodes &&
           routerset_contains_routerstatus(options->ExcludeNodes, rs)) {
         log_warn(LD_DIR, "Wanted to contact authority '%s' for %s, but "





More information about the tor-commits mailing list