Changeset

5753:11cb5f64d029

Merge 0.9->trunk
author Matthew Wild <mwild1@gmail.com>
date Mon, 15 Jul 2013 23:43:37 +0100
parents 5751:3dd3bb40df56 (current diff) 5752:729c78581308 (diff)
children 5756:61521ce49aae
files
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/util-src/net.c	Mon Jul 15 23:35:49 2013 +0100
+++ b/util-src/net.c	Mon Jul 15 23:43:37 2013 +0100
@@ -37,10 +37,10 @@
 
 static int lc_local_addresses(lua_State *L)
 {
+#ifndef _WIN32
 	/* Link-local IPv4 addresses; see RFC 3927 and RFC 5735 */
 	const long ip4_linklocal = htonl(0xa9fe0000); /* 169.254.0.0 */
 	const long ip4_mask      = htonl(0xffff0000);
-#ifndef _WIN32
 	struct ifaddrs *addr = NULL, *a;
 	int n = 1;
 #endif
@@ -56,9 +56,10 @@
 		strerror(errno));
 		return 2;
 	}
-
+#endif
 	lua_newtable(L);
 
+#ifndef _WIN32
 	for (a = addr; a; a = a->ifa_next) {
 		int family;
 		char ipaddr[INET6_ADDRSTRLEN];
@@ -91,9 +92,8 @@
 	}
 
 	freeifaddrs(addr);
-
+#endif
 	return 1;
-#endif
 }
 
 int luaopen_util_net(lua_State* L)