[or-cvs] r15982: Stop trying to detect versions of Tor on the server-side old (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Wed Jul 16 13:15:11 UTC 2008


Author: nickm
Date: 2008-07-16 09:15:11 -0400 (Wed, 16 Jul 2008)
New Revision: 15982

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/or.h
   tor/trunk/src/or/test.c
Log:
Stop trying to detect versions of Tor on the server-side older than 0.1.1.15-rc; they simply do not work any more.  Also add comment about how or_is_obsolete is a terrible field name.

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-07-16 11:45:52 UTC (rev 15981)
+++ tor/trunk/ChangeLog	2008-07-16 13:15:11 UTC (rev 15982)
@@ -28,7 +28,11 @@
       don't reschedule publication of the next descriptor. Fixes bug 763.
       Bugfix on 0.0.9.3.
 
+  o Removed features
+    - Remove all backward-compatibility code to support servers running
+      versions of Tor so old as to no longer work at all on the Tor network.
 
+
 Changes in version 0.2.0.29-rc - 2008-07-08
   o Major bugfixes:
     - If you have more than one bridge but don't know their keys,

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2008-07-16 11:45:52 UTC (rev 15981)
+++ tor/trunk/src/or/circuitbuild.c	2008-07-16 13:15:11 UTC (rev 15982)
@@ -365,9 +365,7 @@
    * (i.e. old or broken) and the other side will let us make a second
    * connection without dropping it immediately... */
   if (!n_conn || n_conn->_base.state != OR_CONN_STATE_OPEN ||
-      (n_conn->_base.or_is_obsolete &&
-       router_digest_version_as_new_as(firsthop->extend_info->identity_digest,
-                                       "0.1.1.9-alpha-cvs"))) {
+      (n_conn->_base.or_is_obsolete)) {
     /* not currently connected */
     circ->_base.n_addr = firsthop->extend_info->addr;
     circ->_base.n_port = firsthop->extend_info->port;
@@ -551,14 +549,10 @@
                                   origin_circuit_t *circ)
 {
   or_options_t *options = get_options();
+  (void) router; /* ignore the router's version. */
 
   if (!options->FastFirstHopPK) /* create_fast is disabled */
     return 0;
-  if (router && router->platform &&
-      !tor_version_as_new_as(router->platform, "0.1.0.6-rc")) {
-    /* known not to work */
-    return 0;
-  }
   if (server_mode(options) && circ->cpath->extend_info->onion_key) {
     /* We're a server, and we know an onion key. We can choose.
      * Prefer to blend in. */
@@ -762,8 +756,7 @@
    * (i.e. old or broken) and the other side will let us make a second
    * connection without dropping it immediately... */
   if (!n_conn || n_conn->_base.state != OR_CONN_STATE_OPEN ||
-    (n_conn->_base.or_is_obsolete &&
-     router_digest_version_as_new_as(id_digest,"0.1.1.9-alpha-cvs"))) {
+      n_conn->_base.or_is_obsolete) {
     struct in_addr in;
     char tmpbuf[INET_NTOA_BUF_LEN];
     in.s_addr = htonl(circ->n_addr);

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2008-07-16 11:45:52 UTC (rev 15981)
+++ tor/trunk/src/or/dirserv.c	2008-07-16 13:15:11 UTC (rev 15982)
@@ -367,6 +367,15 @@
               strmap_size(fingerprint_list->fp_by_name),
               digestmap_size(fingerprint_list->status_by_digest));
 
+  /* 0.1.1.17-rc was the first version that claimed to be stable, doesn't
+   * crash and drop circuits all the time, and is even vaguely compatible with
+   * the current network */
+  if (platform && !tor_version_as_new_as(platform,"0.1.1.17-rc")) {
+    if (msg)
+      *msg = "Tor version is far too old to work.";
+    return FP_REJECT;
+  }
+
   result = dirserv_get_name_status(id_digest, nickname);
   if (result & FP_NAMED) {
     if (should_log)
@@ -437,10 +446,6 @@
         *msg = "Authdir rejects unknown routers.";
       return FP_REJECT;
     }
-    /* 0.1.0.2-rc was the first version that did enough self-testing that
-     * we're willing to take its word about whether it's running. */
-    if (platform && !tor_version_as_new_as(platform,"0.1.0.2-rc"))
-      result |= FP_INVALID;
   }
 
   return result;
@@ -2035,7 +2040,6 @@
                                  int listbadexits, int listbaddirs)
 {
   int unstable_version =
-    tor_version_as_new_as(ri->platform,"0.1.1.10-alpha") &&
     !tor_version_as_new_as(ri->platform,"0.1.1.16-rc-cvs");
   memset(rs, 0, sizeof(routerstatus_t));
 
@@ -2079,10 +2083,7 @@
   rs->is_bad_exit = listbadexits && ri->is_bad_exit;
   ri->is_hs_dir = dirserv_thinks_router_is_hs_dir(ri, now);
   rs->is_hs_dir = ri->is_hs_dir;
-  /* 0.1.1.9-alpha is the first version to support fetch by descriptor
-   * hash. */
-  rs->is_v2_dir = ri->dir_port &&
-    tor_version_as_new_as(ri->platform,"0.1.1.9-alpha");
+  rs->is_v2_dir = ri->dir_port != 0;
 
   if (!strcasecmp(ri->nickname, UNNAMED_ROUTER_NICKNAME))
     rs->is_named = rs->is_unnamed = 0;

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2008-07-16 11:45:52 UTC (rev 15981)
+++ tor/trunk/src/or/or.h	2008-07-16 13:15:11 UTC (rev 15982)
@@ -814,7 +814,9 @@
   /** Edge connections only: true if we've blocked reading until the
    * circuit has fewer queued cells. */
   unsigned int edge_blocked_on_circ:1;
-  /** Used for OR conns that shouldn't get any new circs attached to them. */
+  /** Used for OR conns that shouldn't get any new circs attached to them,
+   * because the connection is too old. */
+  /* XXXX "obsolete" isn't really a good name here. */
   unsigned int or_is_obsolete:1;
   /** For AP connections only. If 1, and we fail to reach the chosen exit,
    * stop requiring it. */

Modified: tor/trunk/src/or/test.c
===================================================================
--- tor/trunk/src/or/test.c	2008-07-16 11:45:52 UTC (rev 15981)
+++ tor/trunk/src/or/test.c	2008-07-16 13:15:11 UTC (rev 15982)
@@ -4072,7 +4072,7 @@
 
   crypto_seed_rng(1);
 
-  if (0) {
+  if (1) {
     bench_aes();
     return 0;
   }



More information about the tor-commits mailing list