[or-cvs] make router_is_me() compare identity, not nickname

Roger Dingledine arma at seul.org
Thu Jul 22 08:08:27 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	router.c 
Log Message:
make router_is_me() compare identity, not nickname


Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- router.c	22 Jul 2004 06:22:04 -0000	1.76
+++ router.c	22 Jul 2004 08:08:25 -0000	1.77
@@ -465,9 +465,11 @@
  */
 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



More information about the tor-commits mailing list