summaryrefslogtreecommitdiff
path: root/src/or/onion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/onion.c')
-rw-r--r--src/or/onion.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index 506eb25e9b..52ef72f407 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -131,9 +131,9 @@ unsigned int *new_route(double cw, routerinfo_t **rarray, size_t rarray_len, siz
choice = choice % (rarray_len);
log(LOG_DEBUG,"new_route() : Chosen router %u.",choice);
- if (choice == oldchoice) /* same router */
- {
- /* try again */
+ if (choice == oldchoice ||
+ (oldchoice < rarray_len && !pkey_cmp(rarray[choice]->pkey, rarray[oldchoice]->pkey))) {
+ /* same router, or router twin. try again. */
i--;
continue;
}