diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-04-06 01:09:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-04-06 01:09:26 +0000 |
commit | 88fe4d6292a363960c9b90b3fe1cadc6434fd114 (patch) | |
tree | 413af5a0901ed2a0b8cefda2f1208cba95afd450 /src/or/dirserv.c | |
parent | 1b5e2182fadd197ef214c19367b37305918fbba5 (diff) | |
download | tor-88fe4d6292a363960c9b90b3fe1cadc6434fd114.tar.gz tor-88fe4d6292a363960c9b90b3fe1cadc6434fd114.zip |
Handle changed router status correctly when reloading fingerprint file
svn:r4016
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 0ecb73f344..06a8f6354c 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -428,17 +428,25 @@ static void directory_remove_unrecognized(void) { int i; + int r; routerinfo_t *ent; if (!descriptor_list) descriptor_list = smartlist_create(); for (i = 0; i < smartlist_len(descriptor_list); ++i) { ent = smartlist_get(descriptor_list, i); - if (dirserv_router_fingerprint_is_known(ent)<=0) { - log(LOG_INFO, "Router '%s' is no longer recognized", + r = dirserv_router_fingerprint_is_known(ent); + if (r<0) { + log(LOG_INFO, "Router '%s' is now verified with a key; removing old router with same name and different key.", ent->nickname); routerinfo_free(ent); smartlist_del(descriptor_list, i--); + } else if (r>0 && !ent->is_verified) { + log(LOG_INFO, "Router '%s' is now approved.", ent->nickname); + ent->is_verified = 1; + } else if (r==0 && ent->is_verified) { + log(LOG_INFO, "Router '%s' is no longer approved." ent->nickname); + ent->is_verified = 0; } } } |