From f00006cf1d966270b6142519ad7d8487fb5eff5a Mon Sep 17 00:00:00 2001 From: Diadlo Date: Tue, 3 Jan 2017 19:26:15 +0300 Subject: Add platform-independent Socket and IP implementation --- toxcore/LAN_discovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toxcore/LAN_discovery.c') 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) * so it's wrapped in __linux for now. * Definitely won't work like this on Windows... */ - sock_t sock = 0; + broadcast_count = 0; + Socket sock = 0; if ((sock = socket(AF_INET, SOCK_STREAM, 0)) < 0) { return; @@ -173,7 +174,7 @@ static void fetch_broadcast_info(uint16_t port) IP_Port *ip_port = &ip_ports[count]; ip_port->ip.family = AF_INET; - ip_port->ip.ip4.in_addr = sock4->sin_addr; + get_ip4(&ip_port->ip.ip4, &sock4->sin_addr); if (ip_port->ip.ip4.uint32 == 0) { continue; -- cgit v1.2.3