]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
make router_is_me() compare identity, not nickname
authorRoger Dingledine <arma@torproject.org>
Thu, 22 Jul 2004 08:08:25 +0000 (08:08 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 22 Jul 2004 08:08:25 +0000 (08:08 +0000)
svn:r2102

src/or/router.c

index 821ccc9a91dc31c12eb513266ef21d8f921619c8..937370ca1471e689a5f6bbc9ad395e19e6a303c8 100644 (file)
@@ -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