diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-10 16:23:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-11 16:12:51 -0400 |
commit | db7b2a33eef9c8d432442b072f9c8868a068bb91 (patch) | |
tree | ce364a8c6abea10a8e21460cdc205f590cb820d5 /src/or/dirserv.c | |
parent | 1d703ed22b249567c2df31db9035a4dda66483ca (diff) | |
download | tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar.gz tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.zip |
Automated conversion of memcmp to tor_memcmp/tor_mem[n]eq
This commit is _exactly_ the result of
perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch]
perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch]
perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch]
perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch]
git checkout src/common/di_ops.[ch]
git checkout src/or/test.c
git checkout src/common/test.h
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 7db6c19a33..efb169bf86 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1991,7 +1991,7 @@ routerstatus_format_entry(char *buf, size_t buf_len, id, dd); return -1; }; - if (memcmp(desc->cache_info.signed_descriptor_digest, + if (tor_memcmp(desc->cache_info.signed_descriptor_digest, rs->descriptor_digest, DIGEST_LEN)) { char rl_d[HEX_DIGEST_LEN+1]; @@ -2007,7 +2007,7 @@ routerstatus_format_entry(char *buf, size_t buf_len, "(router %s)\n", rl_d, rs_d, id); - tor_assert(!memcmp(desc->cache_info.signed_descriptor_digest, + tor_assert(tor_memeq(desc->cache_info.signed_descriptor_digest, rs->descriptor_digest, DIGEST_LEN)); }; @@ -2083,7 +2083,7 @@ _compare_routerinfo_by_ip_and_bw(const void **a, const void **b) /* They're equal! Compare by identity digest, so there's a * deterministic order and we avoid flapping. */ - return memcmp(first->cache_info.identity_digest, + return tor_memcmp(first->cache_info.identity_digest, second->cache_info.identity_digest, DIGEST_LEN); } @@ -2844,7 +2844,7 @@ dirserv_orconn_tls_done(const char *address, SMARTLIST_FOREACH(rl->routers, routerinfo_t *, ri, { if (!strcasecmp(address, ri->address) && or_port == ri->or_port && as_advertised && - !memcmp(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) { + tor_memeq(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) { /* correct digest. mark this router reachable! */ if (!bridge_auth || ri->purpose == ROUTER_PURPOSE_BRIDGE) { log_info(LD_DIRSERV, "Found router %s to be reachable. Yay.", |