aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/net.c
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-07-15 23:43:37 +0100
committerMatthew Wild <mwild1@gmail.com>2013-07-15 23:43:37 +0100
commite5f6bd8c4cda458ae25900c74b4c751913829dd3 (patch)
tree8e5ce2a363febfc45c7cf34f2dd46904487d02a2 /util-src/net.c
parenta4810c029eca0f0b22ebc235051c4ae16d067e3a (diff)
parent6575f3a4e9f527161bb9c711c735f157df91ce9a (diff)
downloadprosody-e5f6bd8c4cda458ae25900c74b4c751913829dd3.tar.gz
prosody-e5f6bd8c4cda458ae25900c74b4c751913829dd3.zip
Merge 0.9->trunk
Diffstat (limited to 'util-src/net.c')
-rw-r--r--util-src/net.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/util-src/net.c b/util-src/net.c
index 37fb12cf..09ba92b8 100644
--- a/util-src/net.c
+++ b/util-src/net.c
@@ -37,10 +37,10 @@ const char * const type_strings[] = {
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 @@ static int lc_local_addresses(lua_State *L)
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 @@ static int lc_local_addresses(lua_State *L)
}
freeifaddrs(addr);
-
- return 1;
#endif
+ return 1;
}
int luaopen_util_net(lua_State* L)