0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00

rand: only try and use freeifaddrs if available

This commit is contained in:
fanquake 2021-03-20 17:57:43 +08:00
parent de4d3ba437
commit 87deac66aa
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -38,7 +38,7 @@
#include <sys/utsname.h> #include <sys/utsname.h>
#include <unistd.h> #include <unistd.h>
#endif #endif
#if HAVE_DECL_GETIFADDRS #if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
#include <ifaddrs.h> #include <ifaddrs.h>
#endif #endif
#if HAVE_SYSCTL #if HAVE_SYSCTL
@ -361,7 +361,7 @@ void RandAddStaticEnv(CSHA512& hasher)
hasher.Write((const unsigned char*)hname, strnlen(hname, 256)); hasher.Write((const unsigned char*)hname, strnlen(hname, 256));
} }
#if HAVE_DECL_GETIFADDRS #if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
// Network interfaces // Network interfaces
struct ifaddrs *ifad = NULL; struct ifaddrs *ifad = NULL;
getifaddrs(&ifad); getifaddrs(&ifad);