Index: adns/INSTALL diff -u adns/INSTALL:1.7 adns/INSTALL:1.10 --- adns/INSTALL:1.7 Sun May 7 23:37:18 2000 +++ adns/INSTALL Wed Aug 9 16:40:10 2000 @@ -17,9 +17,9 @@ In particular, the build system assumes that you have ELF shared libraries. If you don't then please don't send me patches to support your kind of shared libraries, and don't send me patches to use -libtool. I'm not interested in supporting non-ELF shared libraries. -However, if you send me an appropriate patch I'd be willing to make it -easy or automatic to disable the ELF shared library arrangements. +libtool. I'm not interested in supporting non-ELF shared libraries, +and I dislike libtool. If you do not have ELF shared libraries then +please use the --disable-shared configure option. The adnsresfilter utility uses `tsearch' from the C library (a la SVID and X/Open). If your C library doesn't have tsearch you will find @@ -75,7 +75,7 @@ General Public License for more details. You should have received a copy of the GNU General Public License -along with userv as the file COPYING; if not, email me at the address +along with adns as the file COPYING; if not, email me at the address above or write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Index: adns/Makefile.in diff -u adns/Makefile.in:1.19 adns/Makefile.in:1.22 --- adns/Makefile.in:1.19 Sun May 7 23:37:18 2000 +++ adns/Makefile.in Wed Aug 9 16:55:49 2000 @@ -1,7 +1,7 @@ # Makefile - top-level Makefile # # This file is -# Copyright (C) 1997-1999 Ian Jackson +# Copyright (C) 1997-2000 Ian Jackson # # It is part of adns, which is # Copyright (C) 1997-2000 Ian Jackson @@ -21,11 +21,18 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -DISTVERSION= 0.8 +DISTVERSION= 0.9 srcdir= @srcdir@ VPATH= @srcdir@ + +ENABLE_DYNAMIC= @ENABLE_DYNAMIC@ +ifeq ($(ENABLE_DYNAMIC),elf) +SUBDIRS_DYNAMIC=dynamic +else +SUBDIRS_DYNAMIC= +endif -SUBDIRS= src dynamic client regress +SUBDIRS= src $(SUBDIRS_DYNAMIC) client regress all install uninstall clean distclean mostlyclean maintainer-clean distprep: set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done Index: adns/TODO diff -u adns/TODO:1.9 adns/TODO:1.10 --- adns/TODO:1.9 Sat Aug 14 19:55:08 1999 +++ adns/TODO Wed Jun 28 00:16:02 2000 @@ -1,15 +1,10 @@ -INVESTIGATE: -* coredump in adnstest_s - -BUGS: -* adns_qf_quoteok_cname should be the default. - WISHLIST: -* Easy way to make a reverse query. * Make timeouts configurable. * `fake' reverse queries (give nnn.nnn.nnn.nnn either always or on error) * `fake' forward queries (allow nnn.nnn.nnn.nnn -> A) * DNSSEC compatibility - be able to retreive KEY and SIG RRs * DNSSEC minimum functionality - ignore Additional when AD set. * DNSSEC functionality - provide security ? -* Easy-to-use scripting query tool +* Test cancellation in regression tests. +* IPv6 name<->address translation - but which version ?? +* IPv6 transport. Index: adns/changelog diff -u adns/changelog:1.100 adns/changelog:1.116 --- adns/changelog:1.100 Sun May 7 23:37:18 2000 +++ adns/changelog Wed Aug 9 16:59:58 2000 @@ -1,3 +1,35 @@ +adns (0.9) unstable; urgency=high + + Bug fixes: + * Don't make _processany always kill the TCP connection with the message + `TCP connection failed: poll/select: exceptional condition detected'. + * Call MEM_ROUND in __transfer_interim (avoids assert fail + `qu->interim_allocd>=0' on some platforms eg 64 bit). + * adnsresfilter doesn't resolve textual prefixes of addresses (eg, + 10.0.0.1 out of 10.0.0.123) if input happens to block at that point. + * Do not spin if TCP connection blocks for writing (and add test case). + * Fail queries if TCP dies repeatedly, rather than retrying many times. + * Do not abort in a couple of places if TCP unexpectedly broken. + * Do not free something twice if query fails and is then cancelled. + + Portability/compilation fixes: + * Move `extern "C" {' to after #include <...>'s. + * Pass LDFLAGS from configure on to ld via settings.make.in. + * make clean deletes *.so and *.so.* files. + * New --disable-dynamic configure option for non-ELF systems. + * Use AC_PROG_INSTALL (=> perhaps install-sh), to avoid bad `install'. + + Minor improvements: + * Do not print warning if sendto() gives EAGAIN. + * adnsresfilter default timeout changed to 1000ms. + * m1test script can invoke `hrecord' differently. + * regress/output-.report file contains more useful info. + * TODO list and other docs updated slightly. + * Referrals with RD+RA set, or RCODE=Refused, don't generate warnings, + just debug messages. BIND does this kind of thing all the time. + + -- Ian Jackson Wed, 9 Aug 2000 16:59:28 +0100 + adns (0.8) BETA; urgency=medium Bugfixes: Index: adns/configure diff -u adns/configure:1.10 adns/configure:1.12 --- adns/configure:1.10 Wed Nov 24 16:57:32 1999 +++ adns/configure Wed Aug 9 16:26:54 2000 @@ -11,6 +11,9 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --disable-dynamic use static linking + --enable-dynamic[=elf] create and use ELF dynamic library (default)" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -519,10 +522,37 @@ + +echo $ac_n "checking whether you requested dynamic linking""... $ac_c" 1>&6 +echo "configure:528: checking whether you requested dynamic linking" >&5 + +# Check whether --enable-dynamic or --disable-dynamic was given. +if test "${enable_dynamic+set}" = set; then + enableval="$enable_dynamic" + case "$enableval" in + elf|yes) + ENABLE_DYNAMIC=elf + echo "$ac_t""yes (ELF)" 1>&6 + ;; + no) ENABLE_DYNAMIC=no + echo "$ac_t""no" 1>&6 + ;; + *) { echo "configure: error: "invalid value $enableval for --enable-dynamic, try yes or elf"" 1>&2; exit 1; } + ;; + esac + +else + + ENABLE_DYNAMIC=yes + echo "$ac_t""yes, by default" 1>&6 + +fi + + # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:526: checking for $ac_word" >&5 +echo "configure:556: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -551,7 +581,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:555: checking for $ac_word" >&5 +echo "configure:585: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -599,7 +629,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:603: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:633: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -609,11 +639,11 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -633,12 +663,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:637: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:667: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:642: checking whether we are using GNU C" >&5 +echo "configure:672: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -647,7 +677,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:681: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -662,7 +692,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:666: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:696: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -690,7 +720,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:694: checking how to run the C preprocessor" >&5 +echo "configure:724: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -705,13 +735,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:715: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -722,13 +752,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -753,7 +783,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:757: checking for $ac_word" >&5 +echo "configure:787: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -779,16 +809,95 @@ echo "$ac_t""no" 1>&6 fi +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:843: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + for ac_prog in ginstall installbsd scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + # OSF/1 installbsd also uses dspmsg, but is usable. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + for ac_func in poll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:787: checking for $ac_func" >&5 +echo "configure:896: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -837,12 +946,12 @@ echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:841: checking for socket" >&5 +echo "configure:950: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -884,7 +993,7 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:888: checking for socket in -lsocket" >&5 +echo "configure:997: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -892,7 +1001,7 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -939,12 +1048,12 @@ echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6 -echo "configure:943: checking for inet_ntoa" >&5 +echo "configure:1052: checking for inet_ntoa" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_inet_ntoa=yes" else @@ -986,7 +1095,7 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6 -echo "configure:990: checking for inet_ntoa in -lnsl" >&5 +echo "configure:1099: checking for inet_ntoa in -lnsl" >&5 ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -994,7 +1103,7 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1043,12 +1152,12 @@ PROGS_IF_TSEARCH=adnsresfilter echo $ac_n "checking for tsearch""... $ac_c" 1>&6 -echo "configure:1047: checking for tsearch" >&5 +echo "configure:1156: checking for tsearch" >&5 if eval "test \"`echo '$''{'ac_cv_func_tsearch'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_tsearch=yes" else @@ -1098,13 +1207,13 @@ echo $ac_n "checking for INADDR_LOOPBACK""... $ac_c" 1>&6 -echo "configure:1102: checking for INADDR_LOOPBACK" >&5 +echo "configure:1211: checking for INADDR_LOOPBACK" >&5 if eval "test \"`echo '$''{'adns_cv_decl_inaddrloopback'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1117,7 +1226,7 @@ ; return 0; } EOF -if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_decl_inaddrloopback=yes else @@ -1135,17 +1244,17 @@ echo "$ac_t""not in standard headers, urgh..." 1>&6 ac_safe=`echo "rpc/types.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for rpc/types.h""... $ac_c" 1>&6 -echo "configure:1139: checking for rpc/types.h" >&5 +echo "configure:1248: checking for rpc/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1178,12 +1287,12 @@ echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1182: checking for inet_aton" >&5 +echo "configure:1291: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1225,7 +1334,7 @@ echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1229: checking for inet_aton in -lresolv" >&5 +echo "configure:1338: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1233,7 +1342,7 @@ ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1278,20 +1387,20 @@ echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6 -echo "configure:1282: checking __attribute__((,,))" >&5 +echo "configure:1391: checking __attribute__((,,))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_supported=yes else @@ -1313,20 +1422,20 @@ echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6 -echo "configure:1317: checking __attribute__((noreturn))" >&5 +echo "configure:1426: checking __attribute__((noreturn))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_noreturn=yes else @@ -1353,20 +1462,20 @@ echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6 -echo "configure:1357: checking __attribute__((const))" >&5 +echo "configure:1466: checking __attribute__((const))" >&5 if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1479: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_c_attribute_const=yes else @@ -1393,20 +1502,20 @@ echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6 -echo "configure:1397: checking __attribute__((format...))" >&5 +echo "configure:1506: checking __attribute__((format...))" >&5 if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* adns_cv_attribute_format=yes else @@ -1563,6 +1672,7 @@ done ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "settings.make Makefile src/Makefile client/Makefile dynamic/Makefile regress/Makefile @@ -1596,9 +1706,12 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g +s%@ENABLE_DYNAMIC@%$ENABLE_DYNAMIC%g s%@CC@%$CC%g s%@CPP@%$CPP%g s%@RANLIB@%$RANLIB%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PROGS_HAVE_TSEARCH@%$PROGS_HAVE_TSEARCH%g s%@WARNS@%$WARNS%g s%@SHLIBCC@%$SHLIBCC%g @@ -1686,6 +1799,10 @@ top_srcdir="$ac_dots$ac_given_srcdir" ;; esac + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac echo creating "$ac_file" rm -f "$ac_file" @@ -1701,6 +1818,7 @@ s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* Index: adns/configure.in diff -u adns/configure.in:1.12 adns/configure.in:1.15 --- adns/configure.in:1.12 Sun May 7 23:37:18 2000 +++ adns/configure.in Wed Aug 9 16:55:49 2000 @@ -1,7 +1,7 @@ # configure.in - input to autoconf # # This file is -# Copyright (C) 1997-1999 Ian Jackson +# Copyright (C) 1997-2000 Ian Jackson # # It is part of adns, which is # Copyright (C) 1997-2000 Ian Jackson @@ -23,9 +23,33 @@ AC_INIT(src/adns.h) AC_CONFIG_HEADER(src/config.h) + +AC_MSG_CHECKING(whether you requested dynamic linking) +AC_SUBST(ENABLE_DYNAMIC) +AC_ARG_ENABLE(dynamic, +[ --disable-dynamic use static linking + --enable-dynamic[=elf] create and use ELF dynamic library (default)], +[ case "$enableval" in + elf|yes) + ENABLE_DYNAMIC=elf + AC_MSG_RESULT([yes (ELF)]) + ;; + no) ENABLE_DYNAMIC=no + AC_MSG_RESULT(no) + ;; + *) AC_MSG_ERROR( +["invalid value $enableval for --enable-dynamic, try yes or elf"]) + ;; + esac +],[ + ENABLE_DYNAMIC=yes + AC_MSG_RESULT([yes, by default]) +]) + AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB +AC_PROG_INSTALL AC_CHECK_FUNCS(poll) ADNS_C_GETFUNC(socket,socket) Index: adns/settings.make.in diff -u adns/settings.make.in:1.13 adns/settings.make.in:1.16 --- adns/settings.make.in:1.13 Sun May 7 23:37:18 2000 +++ adns/settings.make.in Wed Aug 9 16:55:49 2000 @@ -2,7 +2,7 @@ # used by autoconf/configure to generate settings.make # # This file is -# Copyright (C) 1997-1999 Ian Jackson +# Copyright (C) 1997-2000 Ian Jackson # # It is part of adns, which is # Copyright (C) 1997-2000 Ian Jackson @@ -30,8 +30,10 @@ CC= @CC@ CFLAGS= $(AUTOCFLAGS) $(WARNS) $(WERROR) $(DIRCFLAGS) $(XCFLAGS) +LDFLAGS= $(AUTOLDFLAGS) $(DIRLDFLAGS) $(XLDFLAGS) LDLIBS= @LIBS@ $(XLIBS) AUTOCFLAGS= @CFLAGS@ +AUTOLDFLAGS= @LDFLAGS@ WARNS= @WARNS@ #WERROR= -Werror @@ -50,14 +52,14 @@ lib_dir= $(exec_prefix)/lib include_dir= $(prefix)/include -INSTALL= install -c +INSTALL= @INSTALL@ INSTALL_PROGRAM= $(INSTALL) -m 755 $(INSTALL_PROGRAM_FLAGS) INSTALL_DATA= $(INSTALL) -m 644 all: $(TARGETS) clean mostlyclean: - rm -f *.o *.tmp* + rm -f *.o *.tmp* *.so *.so.* distclean: clean rm -f $(TARGETS) *~ ./#*# core *.orig *.rej Makefile Index: adns/client/Makefile.in diff -u adns/client/Makefile.in:1.21 adns/client/Makefile.in:1.23 --- adns/client/Makefile.in:1.21 Sun May 7 23:37:18 2000 +++ adns/client/Makefile.in Wed Aug 9 16:55:49 2000 @@ -1,7 +1,7 @@ # client/Makefile - client program(s) Makefile # # This file is -# Copyright (C) 1997-1999 Ian Jackson +# Copyright (C) 1997-2000 Ian Jackson # # It is part of adns, which is # Copyright (C) 1997-2000 Ian Jackson @@ -24,14 +24,27 @@ srcdir= @srcdir@ VPATH= @srcdir@ -PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@ +PROGS_SYSDEP= @PROGS_HAVE_TSEARCH@ +ENABLE_DYNAMIC= @ENABLE_DYNAMIC@ PROGRAMS= adnstest adnslogres adnshost $(PROGS_SYSDEP) PROGRAMS_LOCAL= fanftest PROGRAMS_ALL= $(PROGRAMS) $(PROGRAMS_LOCAL) +STATIC_LIB= $(ADNSDIR)/libadns.a + +ifeq ($(ENABLE_DYNAMIC),elf) +DYNAMIC_DEP= $(srcdir)/../dynamic/$(SHLIBFILE) +DYNAMIC_LINK= -L$(srcdir)/../dynamic -ladns +DYNAMIC_SUFFIX= _s +else +DYNAMIC_DEP= $(STATIC_LIB) +DYNAMIC_LINK= $(STATIC_LIB) +DYNAMIC_SUFFIX= +endif + TARG_INSTALL= $(PROGRAMS) -TARG_LOCAL= $(addsuffix _s, $(PROGRAMS_ALL)) +TARG_LOCAL= $(addsuffix $(DYNAMIC_SUFFIX), $(PROGRAMS_ALL)) TARGETS= $(TARG_LOCAL) $(TARG_INSTALL) include $(srcdir)/../settings.make @@ -42,10 +55,6 @@ ALL_OBJS= $(ADH_OBJS) $(TARG_OBJS) ADNSDIR= $(srcdir)/../src/ - -STATIC_LIB= $(ADNSDIR)/libadns.a -DYNAMIC_DEP= $(srcdir)/../dynamic/$(SHLIBFILE) -DYNAMIC_LINK= -L$(srcdir)/../dynamic -ladns all: $(TARGETS) Index: adns/client/adnsresfilter.c diff -u adns/client/adnsresfilter.c:1.7 adns/client/adnsresfilter.c:1.8 --- adns/client/adnsresfilter.c:1.7 Sun May 7 23:37:18 2000 +++ adns/client/adnsresfilter.c Sun May 21 19:34:18 2000 @@ -50,7 +50,7 @@ }; static int bracket, forever, address; -static unsigned long timeout=100; +static unsigned long timeout= 1000; static adns_rrtype rrt= adns_r_ptr; static int outblocked, inputeof; @@ -369,7 +369,6 @@ if (!bracket && !isalnum(c)) startaddr(); } } - if (cbyte==3 && inbyte>0 && !bracket) procaddr(); } static void startup(void) { Index: adns/client/adnstest.c diff -u adns/client/adnstest.c:1.40 adns/client/adnstest.c:1.41 --- adns/client/adnstest.c:1.40 Sun May 7 23:37:18 2000 +++ adns/client/adnstest.c Wed Jun 28 00:01:42 2000 @@ -232,6 +232,8 @@ } if (r) failure_errno("init",r); + setvbuf(stdout,0,_IOLBF,0); + for (qi=0; qi&2 'usage: m1test [] ' + echo >&2 \ +'usage: m1test [] [=] + ' exit 1 fi case="case-$1"; shift initfile="$1"; shift +hrecord="./hrecord" + case "$1" in -*) initflags="$1"; shift esac +case "$1" in +=*) hrecord="`echo \"$1\" | sed -e 's/^=//'`"; shift +esac + queryargs="$*" initstring="`cat init-$initfile.text`" @@ -51,7 +59,7 @@ echo running hrecord $initflags "/... $queryargs" set +e ADNS_TEST_OUT_FD=3 3>>"$case.sys" >"$case.out" 2>"$case.err" @@ -67,6 +64,10 @@ #include #include #include + +#ifdef __cplusplus +extern "C" { /* I really dislike this - iwj. */ +#endif /* All struct in_addr anywhere in adns are in NETWORK byte order. */ Index: adns/src/event.c diff -u adns/src/event.c:1.52 adns/src/event.c:1.54 --- adns/src/event.c:1.52 Sun May 7 23:37:18 2000 +++ adns/src/event.c Wed Jun 28 00:01:42 2000 @@ -54,11 +54,18 @@ void adns__tcp_broken(adns_state ads, const char *what, const char *why) { int serv; + adns_query qu; assert(ads->tcpstate == server_connecting || ads->tcpstate == server_ok); serv= ads->tcpserver; if (what) adns__warn(ads,serv,0,"TCP connection failed: %s: %s",what,why); + if (ads->tcpstate == server_connecting) { + /* Counts as a retry for all the queries waiting for TCP. */ + for (qu= ads->tcpw.head; qu; qu= qu->next) + qu->retries++; + } + tcp_close(ads); ads->tcpstate= server_broken; ads->tcpserver= (serv+1)%ads->nservers; @@ -328,6 +335,7 @@ switch (ads->tcpstate) { case server_disconnected: + case server_broken: case server_connecting: break; case server_ok: @@ -425,6 +433,7 @@ switch (ads->tcpstate) { case server_disconnected: + case server_broken: break; case server_connecting: if (fd != ads->tcpsocket) break; @@ -447,8 +456,8 @@ r= 0; goto xit; } /* not reached */ case server_ok: - if (!(ads->tcpsend.used && fd == ads->tcpsocket)) break; - for (;;) { + if (fd != ads->tcpsocket) break; + while (ads->tcpsend.used) { adns__sigpipe_protect(ads); r= write(ads->tcpsocket,ads->tcpsend.buf,ads->tcpsend.used); adns__sigpipe_unprotect(ads); @@ -462,7 +471,9 @@ ads->tcpsend.used -= r; memmove(ads->tcpsend.buf,ads->tcpsend.buf+r,ads->tcpsend.used); } - } /* not reached */ + } + r= 0; + goto xit; default: abort(); } @@ -476,6 +487,7 @@ adns__consistency(ads,0,cc_entex); switch (ads->tcpstate) { case server_disconnected: + case server_broken: break; case server_connecting: case server_ok: @@ -596,6 +608,7 @@ adns__tcp_broken(ads,0,0); break; case server_disconnected: + case server_broken: break; default: abort(); @@ -619,7 +632,7 @@ * likely just to want to do a read on one or two fds anyway. */ npollfds= adns__pollfds(ads,pollfds); - for (i=0; iallocations,an); LIST_LINK_TAIL(to->allocations,an); + sz= MEM_ROUND(sz); from->interim_allocd -= sz; to->interim_allocd += sz; @@ -422,6 +423,7 @@ adns__vbuf_free(&qu->vb); adns__vbuf_free(&qu->search_vb); free(qu->query_dgram); + qu->query_dgram= 0; } void adns_cancel(adns_query qu) { Index: adns/src/reply.c diff -u adns/src/reply.c:1.39 adns/src/reply.c:1.40 --- adns/src/reply.c:1.39 Sun May 7 23:37:18 2000 +++ adns/src/reply.c Wed Jun 28 01:02:40 2000 @@ -126,7 +126,7 @@ if (qu) adns__query_fail(qu,adns_s_rcodenotimplemented); return; case rcode_refused: - adns__warn(ads,serv,qu,"server refused our query"); + adns__debug(ads,serv,qu,"server refused our query"); if (qu) adns__query_fail(qu,adns_s_rcoderefused); return; default: @@ -287,7 +287,7 @@ if (!flg_rd) adns__diag(ads,serv,qu,"server thinks we didn't ask for recursive lookup"); else - adns__diag(ads,serv,qu,"server claims to do recursion, but gave us a referral"); + adns__debug(ads,serv,qu,"server claims to do recursion, but gave us a referral"); adns__query_fail(qu,adns_s_invalidresponse); } return; Index: adns/src/transmit.c diff -u adns/src/transmit.c:1.20 adns/src/transmit.c:1.21 --- adns/src/transmit.c:1.20 Sun May 7 23:37:18 2000 +++ adns/src/transmit.c Sun May 21 18:21:58 2000 @@ -248,7 +248,7 @@ r= sendto(ads->udpsocket,qu->query_dgram,qu->query_dglen,0, (const struct sockaddr*)&servaddr,sizeof(servaddr)); if (r<0 && errno == EMSGSIZE) { qu->retries= 0; query_usetcp(qu,now); return; } - if (r<0) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno)); + if (r<0 && errno != EAGAIN) adns__warn(ads,serv,0,"sendto failed: %s",strerror(errno)); qu->timeout= now; timevaladd(&qu->timeout,UDPRETRYMS);