diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-24 17:12:54 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-24 17:12:54 +0000 |
commit | d0a5c4f9848f44c46f001428bd3078673033ef19 (patch) | |
tree | 425f4f937cb77c3971267f390f942029d0ea1375 /src/or/routerlist.c | |
parent | ca9e13f2a0c54b4e60868041c7e599546e349319 (diff) | |
download | tor-d0a5c4f9848f44c46f001428bd3078673033ef19.tar tor-d0a5c4f9848f44c46f001428bd3078673033ef19.tar.gz |
r12915@catbus: nickm | 2007-05-24 12:12:34 -0400
Do not send a warning when somebody uploads an extrainfo that we will reject, if it happens to be newer than our current routerdesc.
svn:r10303
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index bb06970ff..c7ecd6a6b 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4964,7 +4964,8 @@ router_differences_are_cosmetic(routerinfo_t *r1, routerinfo_t *r2) return 1; } -/** DOCDOC */ +/** DOCDOC Returns 1 for "reject with message"; -1 for "reject silently", + * 0 for "accept". */ int routerinfo_incompatible_with_extrainfo(routerinfo_t *ri, extrainfo_t *ei, const char **msg) @@ -4972,8 +4973,10 @@ routerinfo_incompatible_with_extrainfo(routerinfo_t *ri, extrainfo_t *ei, tor_assert(ri); tor_assert(ei); - if (ei->bad_sig) + if (ei->bad_sig) { + if (msg) *msg = "Extrainfo signature was bad, or signed with wrong key."; return 1; + } /* The nickname must match exactly to have been generated at the same time * by the same rotuer. */ @@ -4999,10 +5002,10 @@ routerinfo_incompatible_with_extrainfo(routerinfo_t *ri, extrainfo_t *ei, tor_free(ei->pending_sig); } - if (ei->cache_info.published_on < ei->cache_info.published_on) { + if (ei->cache_info.published_on < ri->cache_info.published_on) { if (msg) *msg = "Extrainfo published time did not match routerdesc"; return 1; - } else if (ei->cache_info.published_on > ei->cache_info.published_on) { + } else if (ei->cache_info.published_on > ri->cache_info.published_on) { if (msg) *msg = "Extrainfo published time did not match routerdesc"; return -1; } |