diff --git a/configure b/configure index bbde534..dfaf9dd 100755 --- a/configure +++ b/configure @@ -141,13 +141,19 @@ if [ -z "$CC" ] ; then CC=cc fi -check_compile 'whether netinet/in.h defines s6_addr16' "" \ -'#include \nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }' \ -|| { -check_compile 'whether netinet/in.h defines __u6_addr.__u6_addr16' \ -'-Ds6_addr16=__u6_addr.__u6_addr16 -Ds6_addr32=__u6_addr.__u6_addr32' \ -'#include \nint main(int a, char**c){struct in6_addr x={.s6_addr32[0]=a};return x.s6_addr16[0]; }' -} +for i in 16 32; do + check_compile "whether netinet/in.h defines s6_addr$i" "" \ + '#include \nint main(int a, char**c){'"struct in6_addr x={.s6_addr$i[0]=a};return x.s6_addr$i[0];"' }' \ + || { + check_compile "whether netinet/in.h defines __u6_addr.__u6_addr$i" \ + "-Ds6_addr$i=__u6_addr.__u6_addr$i" \ + '#include \nint main(int a, char**c){'"struct in6_addr x={.s6_addr$i[0]=a};return x.s6_addr$i[0];"' }' || \ + check_compile "whether netinet/in.h defines _S6_un._S6_u$i" \ + "-Ds6_addr$i=_S6_un._S6_u$i" \ + '#include \nint main(int a, char**c){'"struct in6_addr x={.s6_addr$i[0]=a};return x.s6_addr$i[0];"' }' || \ + OUR_CPPFLAGS="$OUR_CPPFLAGS -DNO_S6_ADDR$i" + } +done check_define __OpenBSD__ && \ check_compile_run 'whether OpenBSDs fclose() (illegally) calls close()' \ diff --git a/src/libproxychains.c b/src/libproxychains.c index a540fbb..20d8c49 100644 --- a/src/libproxychains.c +++ b/src/libproxychains.c @@ -336,7 +336,7 @@ int close(int fd) { } static int is_v4inv6(const struct in6_addr *a) { return a->s6_addr32[0] == 0 && a->s6_addr32[1] == 0 && -#ifdef IS_SOLARIS +#ifdef NO_S6_ADDR16 a->s6_addr[8] == 0 && a->s6_addr[9] == 0 && a->s6_addr[10] == 0xff && a->s6_addr[11] == 0xff; #else a->s6_addr16[4] == 0 && a->s6_addr16[5] == 0xffff;