diff --git a/nmap.cc b/nmap.cc index 432946b50..3dd612798 100644 --- a/nmap.cc +++ b/nmap.cc @@ -173,6 +173,10 @@ #include #endif +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #if HAVE_OPENSSL #include #endif diff --git a/nmap.h b/nmap.h index 7a0d31113..4efa0ab32 100644 --- a/nmap.h +++ b/nmap.h @@ -166,11 +166,6 @@ #include /* Defines MAXHOSTNAMELEN on BSD*/ #endif -/* For systems without SCTP in netinet/in.h, such as MacOS X */ -#ifndef IPPROTO_SCTP -#define IPPROTO_SCTP 132 -#endif - /* Keep assert() defined for security reasons */ #undef NDEBUG diff --git a/nse_utility.cc b/nse_utility.cc index b96c30cff..3c0e88abe 100644 --- a/nse_utility.cc +++ b/nse_utility.cc @@ -8,6 +8,10 @@ #include "nse_main.h" #include "nse_utility.h" +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + int nseU_checkinteger (lua_State *L, int arg) { lua_Number n = luaL_checknumber(L, arg); diff --git a/protocols.h b/protocols.h index f5062243c..a4745b457 100644 --- a/protocols.h +++ b/protocols.h @@ -139,6 +139,10 @@ #include #endif +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #define PROTOCOL_TABLE_SIZE 256 struct protocol_list { diff --git a/scan_engine.cc b/scan_engine.cc index 98d0d28b4..f2ab64da3 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -151,6 +151,10 @@ #include "struct_ip.h" +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #include #include #include diff --git a/scan_engine.h b/scan_engine.h index 6b80027d3..607eaf888 100644 --- a/scan_engine.h +++ b/scan_engine.h @@ -139,6 +139,11 @@ #include #include "timing.h" + +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #include #include #include diff --git a/scan_engine_raw.cc b/scan_engine_raw.cc index 5559e5ec0..1ccf7eb0e 100644 --- a/scan_engine_raw.cc +++ b/scan_engine_raw.cc @@ -140,6 +140,10 @@ #include "utils.h" #include +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + extern NmapOps o; /* Pass an arp packet, including ethernet header. Must be 42bytes */ diff --git a/service_scan.cc b/service_scan.cc index 167837e78..794fdde69 100644 --- a/service_scan.cc +++ b/service_scan.cc @@ -168,6 +168,10 @@ # endif #endif +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #include #include diff --git a/traceroute.cc b/traceroute.cc index 0e2b466ac..604c12275 100644 --- a/traceroute.cc +++ b/traceroute.cc @@ -180,6 +180,10 @@ individually. #include "struct_ip.h" +#ifndef IPPROTO_SCTP +#include "libnetutil/netutil.h" +#endif + #include #include