From d4bbce54e82928c43422de97cf42b3b174aa484f Mon Sep 17 00:00:00 2001 From: Stephen Borrill Date: Thu, 9 Apr 2020 13:52:08 +0100 Subject: [PATCH 1/2] Fix detection of IPFilter IPv6 support - include correct headers for autoconf to work - use correct #define value as output by autoconf --- acinclude/os-deps.m4 | 7 +++++++ src/ip/Intercept.cc | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/acinclude/os-deps.m4 b/acinclude/os-deps.m4 index 2f06986da9e..c7351097ee0 100644 --- a/acinclude/os-deps.m4 +++ b/acinclude/os-deps.m4 @@ -930,6 +930,9 @@ AC_DEFUN([SQUID_CHECK_BROKEN_SOLARIS_IPFILTER],[ #if USE_SOLARIS_IPFILTER_MINOR_T_HACK #define minor_t fubar #endif +#if HAVE_SYS_PARAM_H +#include +#endif #if HAVE_SYS_TYPES_H #include #endif @@ -955,7 +958,11 @@ AC_DEFUN([SQUID_CHECK_BROKEN_SOLARIS_IPFILTER],[ #elif HAVE_NETINET_IP_FIL_H #include #endif +#if HAVE_IP_NAT_H #include +#elif HAVE_NETINET_IP_NAT_H +#include +#endif ]) ]) diff --git a/src/ip/Intercept.cc b/src/ip/Intercept.cc index 55fc7303490..9db2424fd58 100644 --- a/src/ip/Intercept.cc +++ b/src/ip/Intercept.cc @@ -204,7 +204,7 @@ Ip::Intercept::IpfInterception(const Comm::ConnectionPointer &newConn, int silen memset(&natLookup, 0, sizeof(natLookup)); // for NAT lookup set local and remote IP:port's if (newConn->remote.isIPv6()) { -#if HAVE_NATLOOKUP_NL_INIPADDR_IN6 +#if HAVE_STRUCT_NATLOOKUP_NL_INIPADDR_IN6 natLookup.nl_v = 6; newConn->local.getInAddr(natLookup.nl_inipaddr.in6); newConn->remote.getInAddr(natLookup.nl_outipaddr.in6); @@ -292,7 +292,7 @@ Ip::Intercept::IpfInterception(const Comm::ConnectionPointer &newConn, int silen debugs(89, 9, HERE << "address: " << newConn); return false; } else { -#if HAVE_NATLOOKUP_NL_REALIPADDR_IN6 +#if HAVE_STRUCT_NATLOOKUP_NL_REALIPADDR_IN6 if (newConn->remote.isIPv6()) newConn->local = natLookup.nl_realipaddr.in6; else From e11503088c908bdd7809b0c6d9a64d3dfe652dae Mon Sep 17 00:00:00 2001 From: Stephen Borrill Date: Thu, 9 Apr 2020 15:04:07 +0100 Subject: [PATCH 2/2] All trailing white space in AC_CHECK_MEMBERS will be converted to underscores so if you have a line break and an indent, instead of HAVE_STRUCT_NATLOOKUP_NL_REALIPADDR_IN6 you get HAVE_STRUCT_NATLOOKUP_NL_REALIPADDR_IN6___ --- acinclude/os-deps.m4 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/acinclude/os-deps.m4 b/acinclude/os-deps.m4 index c7351097ee0..e88ae7b9b79 100644 --- a/acinclude/os-deps.m4 +++ b/acinclude/os-deps.m4 @@ -925,8 +925,7 @@ AC_DEFUN([SQUID_CHECK_BROKEN_SOLARIS_IPFILTER],[ ## Solaris 10+ backported IPv6 NAT to their IPFilter v4.1 instead of using v5 AC_CHECK_MEMBERS([ struct natlookup.nl_inipaddr.in6, - struct natlookup.nl_realipaddr.in6 - ],,,[ + struct natlookup.nl_realipaddr.in6],,,[ #if USE_SOLARIS_IPFILTER_MINOR_T_HACK #define minor_t fubar #endif