aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-11 21:40:35 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-11 21:40:35 +0000
commit3100712c340b9db7195989f1502a8ecbeefe85c9 (patch)
treedec1240abcf327cffb5ea47fe8fdf22080909d76 /src/or/circuitlist.c
parent3de8158b1600927068edf5a723c0e447187b203d (diff)
downloadtor-3100712c340b9db7195989f1502a8ecbeefe85c9.tar
tor-3100712c340b9db7195989f1502a8ecbeefe85c9.tar.gz
r15703@catbus: nickm | 2007-10-11 17:30:34 -0400
Fix for the reported case of bug 438: check families as well as identities in circuit_find_to_cannibalize(). Code audit still pending. ;) svn:r11886
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index d46f763f4..84336c2b1 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -801,7 +801,6 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
{
circuit_t *_circ;
origin_circuit_t *best=NULL;
-// or_options_t *options = get_options();
log_debug(LD_CIRC,
"Hunting for a circ to cannibalize: purpose %d, uptime %d, "
@@ -829,10 +828,16 @@ circuit_find_to_cannibalize(uint8_t purpose, extend_info_t *info,
if (info) {
/* need to make sure we don't duplicate hops */
crypt_path_t *hop = circ->cpath;
+ routerinfo_t *ri1 = router_get_by_digest(info->identity_digest);
do {
+ routerinfo_t *ri2;
if (!memcmp(hop->extend_info->identity_digest,
info->identity_digest, DIGEST_LEN))
goto next;
+ if (ri1 &&
+ (ri2 = router_get_by_digest(hop->extend_info->identity_digest))
+ && routers_in_same_family(ri1, ri2))
+ goto next;
hop=hop->next;
} while (hop!=circ->cpath);
}