From 815725ab843618e1008819fe1449d8473627a114 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 19 May 2015 19:55:43 -0400 Subject: Some fixes. --- toxcore/friend_connection.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'toxcore/friend_connection.c') diff --git a/toxcore/friend_connection.c b/toxcore/friend_connection.c index 7dd8e3e3..1656def0 100644 --- a/toxcore/friend_connection.c +++ b/toxcore/friend_connection.c @@ -158,17 +158,12 @@ int friend_add_tcp_relay(Friend_Connections *fr_c, int friendcon_id, IP_Port ip_ if (!friend_con) return -1; - /* Local ip means that they are hosting a TCP relay. */ - if (Local_ip(ip_port.ip)) { + /* Local ip and same pk means that they are hosting a TCP relay. */ + if (Local_ip(ip_port.ip) && memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { if (friend_con->dht_ip_port.ip.family != 0) { ip_port.ip = friend_con->dht_ip_port.ip; } else { - if (memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { - friend_con->hosting_tcp_relay = 0; - return 0; - } else { - return -1; - } + friend_con->hosting_tcp_relay = 0; } } -- cgit v1.2.3