diff --git a/libnetutil/netutil.cc b/libnetutil/netutil.cc index 6bb86cec5..2350801c4 100644 --- a/libnetutil/netutil.cc +++ b/libnetutil/netutil.cc @@ -116,6 +116,17 @@ #if HAVE_SYS_SOCKIO_H #include /* SIOCGIFCONF for Solaris */ #endif + +#if HAVE_NET_IF_H +#ifndef NET_IF_H /* This guarding is needed for at least some versions of OpenBSD */ +#include +#define NET_IF_H +#endif +#endif +#ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ +#include +#define NETINET_IP_H +#endif #include /* Define CMSG_* symbols for Solaris 9 and earlier. See @@ -152,17 +163,6 @@ #include "netutil.h" -#if HAVE_NET_IF_H -#ifndef NET_IF_H /* This guarding is needed for at least some versions of OpenBSD */ -#include -#define NET_IF_H -#endif -#endif -#ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ -#include -#define NETINET_IP_H -#endif - #if HAVE_SYS_RESOURCE_H #include #endif diff --git a/tcpip.cc b/tcpip.cc index 57abcdb8b..aaf76a4ea 100644 --- a/tcpip.cc +++ b/tcpip.cc @@ -100,7 +100,6 @@ #include "nbase.h" #include "portreasons.h" #include -#include #include "tcpip.h" #include "NmapOps.h" #include "Target.h" @@ -117,6 +116,18 @@ #include #endif +#if HAVE_NET_IF_H +#ifndef NET_IF_H /* This guarding is needed for at least some versions of OpenBSD */ +#include +#define NET_IF_H +#endif +#endif +#ifndef NETINET_IP_H /* This guarding is needed for at least some versions of OpenBSD */ +#include +#define NETINET_IP_H +#endif +#include + #if HAVE_NETINET_IF_ETHER_H #ifndef NETINET_IF_ETHER_H #include