summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index f1cef9f4..c2a0377f 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -675,7 +675,7 @@ IP_Port DHT_getfriendip(DHT *dht, uint8_t *client_id)
675{ 675{
676 uint32_t i, j; 676 uint32_t i, j;
677 uint64_t temp_time = unix_time(); 677 uint64_t temp_time = unix_time();
678 IP_Port empty = { .ip = {0}, .port = 0, .padding = 0 }; 678 IP_Port empty = { .ip = {{0}}, .port = 0, .padding = 0 };
679 679
680 for (i = 0; i < dht->num_friends; ++i) { 680 for (i = 0; i < dht->num_friends; ++i) {
681 /* Equal */ 681 /* Equal */
@@ -1040,7 +1040,7 @@ static void punch_holes(DHT *dht, IP ip, uint16_t *port_list, uint16_t numports,
1040 for (i = dht->friends_list[friend_num].punching_index; i != top; i++) { 1040 for (i = dht->friends_list[friend_num].punching_index; i != top; i++) {
1041 /* TODO: improve port guessing algorithm */ 1041 /* TODO: improve port guessing algorithm */
1042 uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1); 1042 uint16_t port = port_list[(i / 2) % numports] + (i / (2 * numports)) * ((i % 2) ? -1 : 1);
1043 IP_Port pinging = {ip, htons(port)}; 1043 IP_Port pinging = {.ip = ip, .port = htons(port)};
1044 send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id); 1044 send_ping_request(dht->ping, dht->c, pinging, dht->friends_list[friend_num].client_id);
1045 } 1045 }
1046 1046