summaryrefslogtreecommitdiff
path: root/toxcore/net_crypto.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/net_crypto.c')
-rw-r--r--toxcore/net_crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c
index c3ae3663..7607015e 100644
--- a/toxcore/net_crypto.c
+++ b/toxcore/net_crypto.c
@@ -414,7 +414,7 @@ static int send_packet_to(const Net_Crypto *c, int crypt_connection_id, const ui
414 //TODO: detect and kill bad relays. 414 //TODO: detect and kill bad relays.
415 uint32_t i; 415 uint32_t i;
416 416
417 unsigned int r = rand(); 417 unsigned int r = crypt_connection_id;
418 418
419 for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) { 419 for (i = 0; i < MAX_TCP_CONNECTIONS; ++i) {
420 if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */ 420 if (conn->status_tcp[(i + r) % MAX_TCP_CONNECTIONS] == STATUS_TCP_ONLINE) {/* friend is connected to this relay. */