diff options
author | Diadlo <polsha3@gmail.com> | 2017-01-03 19:26:15 +0300 |
---|---|---|
committer | Diadlo <polsha3@gmail.com> | 2017-01-26 23:11:15 +0300 |
commit | f00006cf1d966270b6142519ad7d8487fb5eff5a (patch) | |
tree | b62ef423ad71abfe2f6a53ca0fede7510c07fdd5 /toxcore/LAN_discovery.c | |
parent | 287a29b8269eabfb33f07b9e0388a68be7ad2ba0 (diff) |
Add platform-independent Socket and IP implementation
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r-- | toxcore/LAN_discovery.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toxcore/LAN_discovery.c b/toxcore/LAN_discovery.c index 40c64cda..e26f7eea 100644 --- a/toxcore/LAN_discovery.c +++ b/toxcore/LAN_discovery.c | |||
@@ -121,7 +121,8 @@ static void fetch_broadcast_info(uint16_t port) | |||
121 | * so it's wrapped in __linux for now. | 121 | * so it's wrapped in __linux for now. |
122 | * Definitely won't work like this on Windows... | 122 | * Definitely won't work like this on Windows... |
123 | */ | 123 | */ |
124 | sock_t sock = 0; | 124 | broadcast_count = 0; |
125 | Socket sock = 0; | ||
125 | 126 | ||
126 | if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { | 127 | if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { |
127 | return; | 128 | return; |
@@ -173,7 +174,7 @@ static void fetch_broadcast_info(uint16_t port) | |||
173 | 174 | ||
174 | IP_Port *ip_port = &ip_ports[count]; | 175 | IP_Port *ip_port = &ip_ports[count]; |
175 | ip_port->ip.family = AF_INET; | 176 | ip_port->ip.family = AF_INET; |
176 | ip_port->ip.ip4.in_addr = sock4->sin_addr; | 177 | get_ip4(&ip_port->ip.ip4, &sock4->sin_addr); |
177 | 178 | ||
178 | if (ip_port->ip.ip4.uint32 == 0) { | 179 | if (ip_port->ip.ip4.uint32 == 0) { |
179 | continue; | 180 | continue; |