summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-24 22:11:12 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-24 22:11:12 +0000
commitee8dce3084261447420f0bb7abeb6807583325ee (patch)
treecd748ccd045e59271de63bb30193c2a052f7971a /src/or/router.c
parentb8f1092077159d71734404522add4488a882eac4 (diff)
downloadtor-ee8dce3084261447420f0bb7abeb6807583325ee.tar.gz
tor-ee8dce3084261447420f0bb7abeb6807583325ee.zip
r14421@tombo: nickm | 2008-02-24 17:05:18 -0500
Patch from mwenge: always willingly serve our own extrainfo from the controlport svn:r13699
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 2a2493998d..9b22d86ed1 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1094,6 +1094,19 @@ router_digest_is_me(const char *digest)
return identitykey && !memcmp(identitykey_digest, digest, DIGEST_LEN);
}
+/** Return true iff I'm a server and <b>digest</b> is equal to
+ * my identity digest. */
+int
+router_extrainfo_digest_is_me(const char *digest)
+{
+ if (!router_get_my_extrainfo())
+ return 0;
+
+ return !memcmp(digest,
+ &(router_get_my_extrainfo()->cache_info).signed_descriptor_digest,
+ DIGEST_LEN);
+}
+
/** A wrapper around router_digest_is_me(). */
int
router_is_me(routerinfo_t *router)