]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Report common reasons for rejecting a relay before uncommon ones
authorNick Mathewson <nickm@torproject.org>
Tue, 9 May 2017 14:28:05 +0000 (10:28 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 9 May 2017 14:28:51 +0000 (10:28 -0400)
"You're running 0.2.2; upgrade!" is more sensible than "You have no
ntor key!"

Closes ticket 20270; bugfix on 0.2.9.3-alpha.

changes/bug20270 [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/bug20270 b/changes/bug20270
new file mode 100644 (file)
index 0000000..d538a35
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes (directory authority):
+    - When rejecting a router descriptor because the relay is running an
+      obsolete version of Tor without ntor support, warn about the obsolete
+      tor version, not the missing ntor key. Fixes bug 20270;
+      bugfix on 0.2.9.3-alpha.
+
index fa3938b5ec7048a667280c8599e8fd0cf0196667..0c707a92d22ad588b5b2c0607c32e0884bf40f1f 100644 (file)
@@ -274,6 +274,13 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg,
     return FP_REJECT;
   }
 
+  /* Check for the more usual versions to reject a router first. */
+  const uint32_t r = dirserv_get_status_impl(d, router->nickname,
+                                             router->addr, router->or_port,
+                                             router->platform, msg, severity);
+  if (r)
+    return r;
+
   /* dirserv_get_status_impl already rejects versions older than 0.2.4.18-rc,
    * and onion_curve25519_pkey was introduced in 0.2.4.8-alpha.
    * But just in case a relay doesn't provide or lies about its version, or
@@ -324,9 +331,7 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg,
     }
   }
 
-  return dirserv_get_status_impl(d, router->nickname,
-                                 router->addr, router->or_port,
-                                 router->platform, msg, severity);
+  return 0;
 }
 
 /** Return true if there is no point in downloading the router described by