summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 3f3aef05..151f59d3 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -115,7 +115,7 @@ static int client_id_cmp(ClientPair p1, ClientPair p2)
115 return c; 115 return c;
116} 116}
117 117
118static int ipport_equal(IP_Port a, IP_Port b) 118static int ip4port_equal(IP_Port a, IP_Port b)
119{ 119{
120 return (a.ip.uint32 == b.ip.uint32) && (a.port == b.port); 120 return (a.ip.uint32 == b.ip.uint32) && (a.port == b.port);
121} 121}
@@ -144,7 +144,7 @@ static int client_in_list(Client_data *list, uint32_t length, uint8_t *client_id
144 144
145 for (i = 0; i < length; ++i) { 145 for (i = 0; i < length; ++i) {
146 /* If ip_port is assigned to a different client_id replace it */ 146 /* If ip_port is assigned to a different client_id replace it */
147 if (ipport_equal(list[i].ip_port, ip_port)) { 147 if (ip4port_equal(list[i].ip_port, ip_port)) {
148 memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE); 148 memcpy(list[i].client_id, client_id, CLIENT_ID_SIZE);
149 } 149 }
150 150
@@ -447,7 +447,7 @@ static int is_gettingnodes(DHT *dht, IP_Port ip_port, uint64_t ping_id)
447 if (!is_timeout(temp_time, dht->send_nodes[i].timestamp, PING_TIMEOUT)) { 447 if (!is_timeout(temp_time, dht->send_nodes[i].timestamp, PING_TIMEOUT)) {
448 pinging = 0; 448 pinging = 0;
449 449
450 if (ip_port.ip.uint32 != 0 && ipport_equal(dht->send_nodes[i].ip_port, ip_port)) 450 if (ip_port.ip.uint32 != 0 && ip4port_equal(dht->send_nodes[i].ip_port, ip_port))
451 ++pinging; 451 ++pinging;
452 452
453 if (ping_id != 0 && dht->send_nodes[i].ping_id == ping_id) 453 if (ping_id != 0 && dht->send_nodes[i].ping_id == ping_id)