diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-08-11 10:04:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-08-11 10:04:04 -0400 |
commit | 61d5bcc1a251002d726e66461ec576d9b71cebd1 (patch) | |
tree | 990dfaf04fea2269ac4227b42cdfa75d0f7d1035 /src/feature/relay | |
parent | b7ed61167fb3ed9d3b623d008bf3360a3ffa95c4 (diff) | |
parent | 5f2e00241a35f7658bde4f9afb0a758588217e40 (diff) | |
download | tor-61d5bcc1a251002d726e66461ec576d9b71cebd1.tar.gz tor-61d5bcc1a251002d726e66461ec576d9b71cebd1.zip |
Merge remote-tracking branch 'tor-github/pr/268'
Diffstat (limited to 'src/feature/relay')
-rw-r--r-- | src/feature/relay/router.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 0cc4887232..e4ec01af24 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -164,22 +164,12 @@ routerinfo_err_to_string(int err) int routerinfo_err_is_transient(int err) { - switch (err) { - case TOR_ROUTERINFO_ERROR_NO_EXT_ADDR: - return 1; - case TOR_ROUTERINFO_ERROR_CANNOT_PARSE: - return 1; - case TOR_ROUTERINFO_ERROR_NOT_A_SERVER: - return 0; - case TOR_ROUTERINFO_ERROR_DIGEST_FAILED: - return 0; // XXX: bug? - case TOR_ROUTERINFO_ERROR_CANNOT_GENERATE: - return 1; - case TOR_ROUTERINFO_ERROR_DESC_REBUILDING: - return 1; - } - - return 0; + /** + * For simplicity, we consider all errors other than + * "not a server" transient - see discussion on + * https://trac.torproject.org/projects/tor/ticket/27034 + */ + return err != TOR_ROUTERINFO_ERROR_NOT_A_SERVER; } /** Replace the current onion key with <b>k</b>. Does not affect @@ -2360,8 +2350,8 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e) } ri->identity_pkey = crypto_pk_dup_key(get_server_identity_key()); - if (crypto_pk_get_digest(ri->identity_pkey, - ri->cache_info.identity_digest)<0) { + if (BUG(crypto_pk_get_digest(ri->identity_pkey, + ri->cache_info.identity_digest) < 0)) { routerinfo_free(ri); return TOR_ROUTERINFO_ERROR_DIGEST_FAILED; } |