Skip to content

Commit

Permalink
rand: only try and use freeifaddrs if available
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Mar 29, 2021
1 parent de4d3ba commit 87deac6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/randomenv.cpp
Expand Up @@ -38,7 +38,7 @@
#include <sys/utsname.h>
#include <unistd.h>
#endif
#if HAVE_DECL_GETIFADDRS
#if HAVE_DECL_GETIFADDRS && HAVE_DECL_FREEIFADDRS
#include <ifaddrs.h>
#endif
#if HAVE_SYSCTL
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 87deac6

Please sign in to comment.