diff options
author | irungentoo <irungentoo@gmail.com> | 2013-09-15 09:47:17 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-09-15 09:47:17 -0400 |
commit | bbeb6e15cdd4135f1922146741d8c9d709f808eb (patch) | |
tree | 107e1f18992245ad6b2883fcc316a2236d53fdc8 | |
parent | 43b609d41cd24435eccf6ead89f12fff888915f4 (diff) |
Fixed portability problems.
-rw-r--r-- | toxcore/DHT.c | 4 | ||||
-rw-r--r-- | toxcore/LAN_discovery.c | 2 |
2 files changed, 3 insertions, 3 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) |
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index db07755d..cf4196d2 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -171,7 +171,7 @@ static int LAN_ip(IP ip) | |||
171 | return 0; | 171 | return 0; |
172 | 172 | ||
173 | /* embedded IPv4-in-IPv6 */ | 173 | /* embedded IPv4-in-IPv6 */ |
174 | if (IN6_IS_ADDR_V4MAPPED(&ip.ip6)) { | 174 | if (IN6_IS_ADDR_V4MAPPED(&ip.ip6.in6_addr)) { |
175 | IP ip4; | 175 | IP ip4; |
176 | ip4.family = AF_INET; | 176 | ip4.family = AF_INET; |
177 | ip4.ip4.uint32 = ip.ip6.uint32[3]; | 177 | ip4.ip4.uint32 = ip.ip6.uint32[3]; |