diff options
author | Roger Dingledine <arma@torproject.org> | 2004-07-22 08:08:25 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-07-22 08:08:25 +0000 |
commit | ea43172c11af49dcf770fdcbcf80fcbef3437c19 (patch) | |
tree | d62495e281cc6a9844546f5b7b4073863d019bd3 /src | |
parent | a7d16e38eb19e668dca9acdc0cde08a1f673844a (diff) | |
download | tor-ea43172c11af49dcf770fdcbcf80fcbef3437c19.tar tor-ea43172c11af49dcf770fdcbcf80fcbef3437c19.tar.gz |
make router_is_me() compare identity, not nickname
svn:r2102
Diffstat (limited to 'src')
-rw-r--r-- | src/or/router.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c index 821ccc9a9..937370ca1 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -465,9 +465,11 @@ int router_compare_to_my_exit_policy(connection_t *conn) */ int router_is_me(routerinfo_t *router) { + routerinfo_t *me = router_get_my_routerinfo(); tor_assert(router); - /* XXXX008 should compare identity instead? */ - return options.Nickname && !strcasecmp(router->nickname, options.Nickname); + if(!me || memcmp(me->identity_digest, router->identity_digest, DIGEST_LEN)) + return 0; + return 1; } /** Return a routerinfo for this OR, rebuilding a fresh one if |