summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-09-15 09:47:17 -0400
committerirungentoo <irungentoo@gmail.com>2013-09-15 09:47:17 -0400
commitbbeb6e15cdd4135f1922146741d8c9d709f808eb (patch)
tree107e1f18992245ad6b2883fcc316a2236d53fdc8 /toxcore/DHT.c
parent43b609d41cd24435eccf6ead89f12fff888915f4 (diff)
Fixed portability problems.
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 32a1d96d..2f7b2263 100644
--- a/toxcore/DHT.c
+++ b/toxcore/DHT.c
@@ -221,7 +221,7 @@ static void get_close_nodes_inner(DHT *dht, uint8_t *client_id, Node_format *nod
221 (client_ip->family == AF_INET6)) { 221 (client_ip->family == AF_INET6)) {
222 /* socket is AF_INET6, address claims AF_INET6: 222 /* socket is AF_INET6, address claims AF_INET6:
223 * check for embedded IPv4-in-IPv6 */ 223 * check for embedded IPv4-in-IPv6 */
224 if (IN6_IS_ADDR_V4MAPPED(&client_ip->ip6)) 224 if (IN6_IS_ADDR_V4MAPPED(&client_ip->ip6.in6_addr))
225 ip_treat_as_family = AF_INET; 225 ip_treat_as_family = AF_INET;
226 } 226 }
227 227
@@ -562,7 +562,7 @@ static int sendnodes(DHT *dht, IP_Port ip_port, uint8_t *public_key, uint8_t *cl
562 562
563 IP *node_ip = &nodes_list[i].ip_port.ip; 563 IP *node_ip = &nodes_list[i].ip_port.ip;
564 564
565 if ((node_ip->family == AF_INET6) && IN6_IS_ADDR_V4MAPPED(&node_ip->ip6)) 565 if ((node_ip->family == AF_INET6) && IN6_IS_ADDR_V4MAPPED(&node_ip->ip6.in6_addr))
566 /* embedded IPv4-in-IPv6 address: return it in regular sendnodes packet */ 566 /* embedded IPv4-in-IPv6 address: return it in regular sendnodes packet */
567 nodes4_list[num_nodes_ok].ip_port.ip.uint32 = node_ip->ip6.uint32[3]; 567 nodes4_list[num_nodes_ok].ip_port.ip.uint32 = node_ip->ip6.uint32[3];
568 else if (node_ip->family == AF_INET) 568 else if (node_ip->family == AF_INET)