--- src/def.h
+++ src/def.h
@@ -32,7 +32,6 @@
 #include <time.h>
 #include <limits.h>
 #include <poll.h>
-#include <ifaddrs.h>
 #define _NET_IF_ARP_H_ /* OpenBSD's if.h takes in if_arp.h */
 #include <arpa/inet.h>
 #include <sys/ioctl.h>
@@ -41,6 +40,9 @@
 #ifdef __BSD_VISIBLE /* Linux does not have net/if_dl.h */
 #include <net/if_dl.h>
 #endif
+#ifndef SIOCGIFHWADDR
+#include <ifaddrs.h>
+#endif
 #include <pcap.h>
 
 #define BITTWIST_VERSION    "1.1"
