From e99d6d0c7cbdbb23f966e50c045bbd525ba8daf0 Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 20 Mar 2021 17:57:43 +0800 Subject: rand: only try and use freeifaddrs if available Github-Pull: #21486 Rebased-From: 87deac66aa747481e6f34fc80599e1e490de3ea0 --- src/randomenv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/randomenv.cpp b/src/randomenv.cpp index 07122b7f6d..79ab8daf6a 100644 --- a/src/randomenv.cpp +++ b/src/randomenv.cpp @@ -38,7 +38,7 @@ #include #include #endif -#if HAVE_DECL_GETIFADDRS +#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS #include #endif #if HAVE_SYSCTL @@ -361,7 +361,7 @@ void RandAddStaticEnv(CSHA512& hasher) hasher.Write((const unsigned char*)hname, strnlen(hname, 256)); } -#if HAVE_DECL_GETIFADDRS +#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS // Network interfaces struct ifaddrs *ifad = NULL; getifaddrs(&ifad); -- cgit v1.2.3 From 1a9a2cb7dcc60781a3cbca3a7846ff153143260c Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 26 Mar 2021 12:53:05 +0800 Subject: net: add ifaddrs.h include Github-Pull: #21486 Rebased-From: 4783115fd4cccb46a7f8c592b34fa7c094c29410 --- src/net.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/net.cpp b/src/net.cpp index 1fd913eb64..15e52de94d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -28,6 +28,10 @@ #include #endif +#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS +#include +#endif + #ifdef USE_POLL #include #endif -- cgit v1.2.3