summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/DHT.c')
-rw-r--r--toxcore/DHT.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/DHT.c b/toxcore/DHT.c
index 41c24ac0..a4251518 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -565,7 +565,7 @@ static void update_client(Logger *log, int index, Client_data *client, IP_Port i
565 net_ntohs(ip_port.port)); 565 net_ntohs(ip_port.port));
566 } 566 }
567 567
568 if (LAN_ip(assoc->ip_port.ip) != 0 && LAN_ip(ip_port.ip) == 0) { 568 if (ip_is_lan(assoc->ip_port.ip) != 0 && ip_is_lan(ip_port.ip) == 0) {
569 return; 569 return;
570 } 570 }
571 571
@@ -702,11 +702,11 @@ static void get_close_nodes_inner(const uint8_t *public_key, Node_format *nodes_
702 } 702 }
703 703
704 /* don't send LAN ips to non LAN peers */ 704 /* don't send LAN ips to non LAN peers */
705 if (LAN_ip(ipptp->ip_port.ip) == 0 && !is_LAN) { 705 if (ip_is_lan(ipptp->ip_port.ip) == 0 && !is_LAN) {
706 continue; 706 continue;
707 } 707 }
708 708
709 if (LAN_ip(ipptp->ip_port.ip) != 0 && want_good && hardening_correct(&ipptp->hardening) != HARDENING_ALL_OK 709 if (ip_is_lan(ipptp->ip_port.ip) != 0 && want_good && hardening_correct(&ipptp->hardening) != HARDENING_ALL_OK
710 && !id_equal(public_key, client->public_key)) { 710 && !id_equal(public_key, client->public_key)) {
711 continue; 711 continue;
712 } 712 }
@@ -1223,7 +1223,7 @@ static int sendnodes_ipv6(const DHT *dht, IP_Port ip_port, const uint8_t *public
1223 size_t Node_format_size = sizeof(Node_format); 1223 size_t Node_format_size = sizeof(Node_format);
1224 1224
1225 Node_format nodes_list[MAX_SENT_NODES]; 1225 Node_format nodes_list[MAX_SENT_NODES];
1226 uint32_t num_nodes = get_close_nodes(dht, client_id, nodes_list, 0, LAN_ip(ip_port.ip) == 0, 1); 1226 uint32_t num_nodes = get_close_nodes(dht, client_id, nodes_list, 0, ip_is_lan(ip_port.ip) == 0, 1);
1227 1227
1228 VLA(uint8_t, plain, 1 + Node_format_size * MAX_SENT_NODES + length); 1228 VLA(uint8_t, plain, 1 + Node_format_size * MAX_SENT_NODES + length);
1229 1229
@@ -2840,11 +2840,11 @@ int DHT_non_lan_connected(const DHT *dht)
2840 for (uint32_t i = 0; i < LCLIENT_LIST; ++i) { 2840 for (uint32_t i = 0; i < LCLIENT_LIST; ++i) {
2841 const Client_data *client = &dht->close_clientlist[i]; 2841 const Client_data *client = &dht->close_clientlist[i];
2842 2842
2843 if (!is_timeout(client->assoc4.timestamp, BAD_NODE_TIMEOUT) && LAN_ip(client->assoc4.ip_port.ip) == -1) { 2843 if (!is_timeout(client->assoc4.timestamp, BAD_NODE_TIMEOUT) && ip_is_lan(client->assoc4.ip_port.ip) == -1) {
2844 return 1; 2844 return 1;
2845 } 2845 }
2846 2846
2847 if (!is_timeout(client->assoc6.timestamp, BAD_NODE_TIMEOUT) && LAN_ip(client->assoc6.ip_port.ip) == -1) { 2847 if (!is_timeout(client->assoc6.timestamp, BAD_NODE_TIMEOUT) && ip_is_lan(client->assoc6.ip_port.ip) == -1) {
2848 return 1; 2848 return 1;
2849 } 2849 }
2850 } 2850 }