--------------------- PatchSet 5527 Date: 2007/08/29 11:23:15 Author: amosjeffries Branch: squid3-ipv6 Tag: (none) Log: Final part: FreeBSD _res updates for IPv6. Makes _SQUID_NSADDR6_LIST(i) a portable array of sockaddr_in6 using i as the access index regardless of the type of native OS storage. Members: configure.in:1.63.2.52->1.63.2.53 src/dnsserver.cc:1.7.4.18->1.7.4.19 Index: squid3/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid3/configure.in,v retrieving revision 1.63.2.52 retrieving revision 1.63.2.53 diff -u -r1.63.2.52 -r1.63.2.53 --- squid3/configure.in 29 Aug 2007 05:31:27 -0000 1.63.2.52 +++ squid3/configure.in 29 Aug 2007 11:23:15 -0000 1.63.2.53 @@ -1,7 +1,7 @@ dnl Configuration input file for Squid dnl -dnl $Id: configure.in,v 1.63.2.52 2007/08/29 05:31:27 amosjeffries Exp $ +dnl $Id: configure.in,v 1.63.2.53 2007/08/29 11:23:15 amosjeffries Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AC_CONFIG_SRCDIR([src/main.cc]) AM_INIT_AUTOMAKE([tar-ustar]) -AC_REVISION($Revision: 1.63.2.52 $)dnl +AC_REVISION($Revision: 1.63.2.53 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -3256,19 +3256,6 @@ fi dnl Detect what resolver fields we need to use... -##### -struct __res_state_ext { - struct sockaddr_storage nsaddr_list[MAXNS]; - struct { - int af; /* address family for addr, mask */ - union { - struct in_addr ina; - struct in6_addr in6a; - } addr, mask; - } sort_list[MAXRESOLVSORT]; -}; -####### - AC_CACHE_CHECK(for _res_ext.nsaddr_list, ac_cv_have_res_ext_nsaddr_list, AC_TRY_COMPILE([ #if HAVE_SYS_TYPES_H @@ -3291,7 +3278,7 @@ ac_cv_have_res_ext_nsaddr_list="yes", ac_cv_have_res_ext_nsaddr_list="no")) if test "$ac_cv_have_res_ext_nsaddr_list" = "yes" ; then - AC_DEFINE(_SQUID_RES_NSADDR6_LIST,_res_ext.nsaddr_list,[If _res_ext structure has nsaddr_list member]) + AC_DEFINE(_SQUID_RES_NSADDR6_LIST(i),_res_ext.nsaddr_list[[(i)]].sin6_addr,[If _res_ext structure has nsaddr_list member]) AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,ns6count,[Nameserver Counter for IPv6 _res_ext]) fi @@ -3318,8 +3305,8 @@ ac_cv_have_res_ext_nsaddrs="yes", ac_cv_have_res_ext_nsaddrs="no")) if test "$ac_cv_have_res_ext_nsaddrs" = "yes" ; then - AC_DEFINE(_SQUID_RES_NSADDR6_LIST,_res._u._ext.nsaddrs,[If _res structure has _ext.nsaddrs member]) - AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,_res._u._ext.nscount6,[Nameserver Counter for IPv6 _res]) + AC_DEFINE(_SQUID_RES_NSADDR6_LIST(i),[_res._u._ext.nsaddrs[[(i)]]->sin6_addr],[If _res structure has _ext.nsaddrs member]) + AC_DEFINE(_SQUID_RES_NSADDR6_COUNT,[_res._u._ext.nscount6],[Nameserver Counter for IPv6 _res]) fi fi Index: squid3/src/dnsserver.cc =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/dnsserver.cc,v retrieving revision 1.7.4.18 retrieving revision 1.7.4.19 diff -u -r1.7.4.18 -r1.7.4.19 --- squid3/src/dnsserver.cc 29 Aug 2007 05:36:52 -0000 1.7.4.18 +++ squid3/src/dnsserver.cc 29 Aug 2007 11:23:17 -0000 1.7.4.19 @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.cc,v 1.7.4.18 2007/08/29 05:36:52 amosjeffries Exp $ + * $Id: dnsserver.cc,v 1.7.4.19 2007/08/29 11:23:17 amosjeffries Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -405,7 +405,7 @@ } _SQUID_RES_NSADDR_COUNT++; - ipa.GetInAddr(_SQUID_RES_NSADDR6_LIST[_SQUID_RES_NSADDR6_COUNT++]->sin6_addr); + ipa.GetInAddr(_SQUID_RES_NSADDR6_LIST(_SQUID_RES_NSADDR6_COUNT++)); #else fprintf(stderr, "IPv6 nameservers not supported on this resolver\n"); #endif