summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-09 10:28:05 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-09 10:28:51 -0400
commitff7e8531ec44ce5ebdb7506ab3133e566fddfc20 (patch)
treeebb1b12222a2914f013b32a19bf3dba1285f81ba /src/or/dirserv.c
parent0df22e8f5f5c4e1a329f2930f6eb9ecde1cf9848 (diff)
downloadtor-ff7e8531ec44ce5ebdb7506ab3133e566fddfc20.tar.gz
tor-ff7e8531ec44ce5ebdb7506ab3133e566fddfc20.zip
Report common reasons for rejecting a relay before uncommon ones
"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.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index fa3938b5ec..0c707a92d2 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -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