summaryrefslogtreecommitdiff
path: root/toxcore/LAN_discovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/LAN_discovery.c')
-rw-r--r--toxcore/LAN_discovery.c5
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;