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

[or-cvs] r8756: Change to BadExit logic: Let authorities set an "I list bad (in tor/trunk: . doc src/or)



Author: nickm
Date: 2006-10-19 11:45:48 -0400 (Thu, 19 Oct 2006)
New Revision: 8756

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/doc/dir-spec.txt
   tor/trunk/doc/path-spec.txt
   tor/trunk/src/or/or.h
   tor/trunk/src/or/routerlist.c
   tor/trunk/src/or/routerparse.c
Log:
 r9091@totoro:  nickm | 2006-10-19 11:45:28 -0400
 Change to BadExit logic: Let authorities set an "I list bad exits" flag.  Consider an exit bad if it is listed as bad by more than half of *those* authorities.  This gives us a better migration path.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9091] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/ChangeLog	2006-10-19 15:45:48 UTC (rev 8756)
@@ -1,7 +1,8 @@
 Changes in version 0.1.2.3-alpha - 2006-10-??
   o Minor features:
-    - If most authorities set a (newly defined) BadExit flag for a server, do
-      not consider it as a general-purpose exit.
+    - If most authorities set a (newly defined) BadExit flag for a server,
+      do not consider it as a general-purpose exit.  Only consider
+      authorities that advertise themselves as listing bad exits.
 
   o Minor features, controller:
     - Add a REASON field to CIRC events; for backward compatibility, this

Modified: tor/trunk/doc/dir-spec.txt
===================================================================
--- tor/trunk/doc/dir-spec.txt	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/doc/dir-spec.txt	2006-10-19 15:45:48 UTC (rev 8756)
@@ -329,6 +329,8 @@
       "dir-options" -- A set of flags, in any order, separated by whitespace:
           "Names" if this directory authority performs name bindings.
           "Versions" if this directory authority recommends software versions.
+          "BadExits" if the directory authority flags nodes that it believes
+              are performing incorrectly as exit nodes.
 
    The dir-options entry is optional.  The "-versions" entries are required if
    the "Versions" flag is present.  The other entries are required and must

Modified: tor/trunk/doc/path-spec.txt
===================================================================
--- tor/trunk/doc/path-spec.txt	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/doc/path-spec.txt	2006-10-19 15:45:48 UTC (rev 8756)
@@ -208,8 +208,9 @@
    such a connection if any clause that accepts any connections to that port
    precedes all clauses (if any) that reject all connections to that port.
 
-   Unless requested to do so by the user, we never choose a server flagged by
-   more than half of the authorities as BadExit for an exit server.
+   Unless requested to do so by the user, we never choose an exit server
+   flagged as "BadExit" by more than half of the authorities who advertise
+   themselves as listing bad exits.
 
 2.2.2. User configuration
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/src/or/or.h	2006-10-19 15:45:48 UTC (rev 8756)
@@ -1041,6 +1041,8 @@
   unsigned int recommends_versions:1; /**< True iff this directory server
                                        * recommends client and server software
                                        * versions. */
+  unsigned int lists_bad_exits:1; /** True iff this directory server marks
+                                   * malfunctioning exits as bad. */
 
   smartlist_t *entries; /**< List of routerstatus_t*.   This list is kept
                          * sorted by identity_digest. */

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/src/or/routerlist.c	2006-10-19 15:45:48 UTC (rev 8756)
@@ -3178,6 +3178,7 @@
 {
   or_options_t *options = get_options();
   int n_trusted, n_statuses, n_recent = 0, n_naming = 0;
+  int n_listing_bad_exits = 0;
   int i, j, warned;
   int *index, *size;
   networkstatus_t **networkstatus;
@@ -3225,6 +3226,8 @@
       ++n_naming;
     if (networkstatus[i]->is_recent)
       ++n_recent;
+    if (networkstatus[i]->lists_bad_exits)
+      ++n_listing_bad_exits;
   }
 
   /** Iterate over all entries in all networkstatuses, and build
@@ -3430,7 +3433,7 @@
     rs_out->status.is_possible_guard = n_guard > n_statuses/2;
     rs_out->status.is_stable = n_stable > n_statuses/2;
     rs_out->status.is_v2_dir = n_v2_dir > n_statuses/2;
-    rs_out->status.is_bad_exit = n_bad_exit > n_statuses/2;
+    rs_out->status.is_bad_exit = n_bad_exit > n_listing_bad_exits/2;
   }
   SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
                     local_routerstatus_free(rs));

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2006-10-19 15:02:06 UTC (rev 8755)
+++ tor/trunk/src/or/routerparse.c	2006-10-19 15:45:48 UTC (rev 8756)
@@ -1205,6 +1205,8 @@
         ns->binds_names = 1;
       if (!strcmp(tok->args[i], "Versions"))
         ns->recommends_versions = 1;
+      if (!strcmp(tok->args[i], "BadExits"))
+        ns->lists_bad_exits = 1;
     }
   }