aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--src/net.cpp2
2 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0b96e15b9e..4d84aacce1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -733,6 +733,10 @@ fi
AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
+AC_CHECK_DECLS([getifaddrs, freeifaddrs],,,
+ [#include <sys/types.h>
+ #include <ifaddrs.h>]
+)
AC_CHECK_DECLS([strnlen])
# Check for daemon(3), unrelated to --with-daemon (although used by it)
diff --git a/src/net.cpp b/src/net.cpp
index c51a1b4a74..f83f39a67d 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2167,7 +2167,7 @@ void Discover()
}
}
}
-#else
+#elif (HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS)
// Get local host ip
struct ifaddrs* myaddrs;
if (getifaddrs(&myaddrs) == 0)