diff options
author | Roger Dingledine <arma@torproject.org> | 2007-10-10 19:53:08 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-10-10 19:53:08 +0000 |
commit | f6b25613b8683f41149e4b64443e30b94d64ad3b (patch) | |
tree | 01969b3454e3cd379a741d7dcf9a56caa708b2dc /src/or/dirserv.c | |
parent | 55520a2d95cafeaebf7073660fd70b3a3019d035 (diff) | |
download | tor-f6b25613b8683f41149e4b64443e30b94d64ad3b.tar.gz tor-f6b25613b8683f41149e4b64443e30b94d64ad3b.zip |
Tweak the implementation of proposal 109 slightly: allow at most
two Tor servers on the same IP address, except if it's the location
of a directory authority, in which case allow five.
svn:r11842
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 08d5318ed6..7d69aa21a4 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1840,7 +1840,10 @@ get_possible_sybil_list(const smartlist_t *routers) smartlist_sort(routers_by_ip, _compare_routerinfo_by_ip_and_bw); omit_as_sybil = digestmap_new(); -#define MAX_WITH_SAME_ADDR 3 +/* Allow at most this number of Tor servers on a single IP address, ... */ +#define MAX_WITH_SAME_ADDR 2 +/* ... unless it's a directory authority, in which case allow more. */ +#define MAX_WITH_SAME_ADDR_ON_AUTHORITY 5 last_addr = 0; addr_count = 0; SMARTLIST_FOREACH(routers_by_ip, routerinfo_t *, ri, @@ -1849,7 +1852,9 @@ get_possible_sybil_list(const smartlist_t *routers) last_addr = ri->addr; addr_count = 1; } else if (++addr_count > MAX_WITH_SAME_ADDR) { - digestmap_set(omit_as_sybil, ri->cache_info.identity_digest, ri); + if (!router_digest_is_trusted_dir(ri->cache_info.identity_digest) || + addr_count > MAX_WITH_SAME_ADDR_ON_AUTHORITY) + digestmap_set(omit_as_sybil, ri->cache_info.identity_digest, ri); } }); |