Codebase list unbound / upstream/1.4.4
Imported Upstream version 1.4.4 Robert S. Edmonds 12 years ago
115 changed file(s) with 3892 addition(s) and 2394 deletion(s). Raw diff Collapse all Expand all
7373 LINTFLAGS=+quiet -weak -warnposix -unrecog -Din_addr_t=uint32_t -Du_int=unsigned -Du_char=uint8_t -preproc -Drlimit=rlimit64 -D__gnuc_va_list=va_list -Dglob64=glob -Dglobfree64=globfree
7474 # compat with openssl linux edition.
7575 LINTFLAGS+="-DBN_ULONG=unsigned long" -Dkrb5_int32=int "-Dkrb5_ui_4=unsigned int" -DPQ_64BIT=uint64_t -DRC4_INT=unsigned -fixedformalarray
76 # compat with NetBSD
77 ifeq "$(shell uname)" "NetBSD"
78 LINTFLAGS+="-D__RENAME(x)=" -D_NETINET_IN_H_
79 endif
80 # compat with OpenBSD
81 LINTFLAGS+="-Dsigset_t=long"
82 # FreeBSD8
83 LINTFLAGS+="-D__uint16_t=uint16_t"
7684
7785 INSTALL=$(srcdir)/install-sh
7886 ifeq "$(WITH_PYTHONMODULE)" "yes"
650650
651651 #ifdef HAVE_WS2TCPIP_H
652652 #include <ws2tcpip.h>
653 #endif
654
655 #ifdef HAVE_GETOPT_H
656 #include <getopt.h>
657 #endif
658
659 #ifdef HAVE_OPENSSL_ERR_H
660 #include <openssl/err.h>
661 #endif
662
663 #ifdef HAVE_OPENSSL_RAND_H
664 #include <openssl/rand.h>
665 #endif
666
667 #ifdef HAVE_OPENSSL_CONF_H
668 #include <openssl/conf.h>
669 #endif
670
671 #ifdef HAVE_OPENSSL_ENGINE_H
672 #include <openssl/engine.h>
673653 #endif
674654
675655
817797 struct sockaddr_storage;
818798 #include "compat/fake-rfc2553.h"
819799 #endif
820
821 #include "ldns/ldns.h"
822800
823801 #ifdef UNBOUND_ALLOC_STATS
824802 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
+2497
-2093
configure less more
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.63 for unbound 1.4.3.
2 # Generated by GNU Autoconf 2.63 for unbound 1.4.4.
33 #
44 # Report bugs to <unbound-bugs@nlnetlabs.nl>.
55 #
744744 # Identity of this package.
745745 PACKAGE_NAME='unbound'
746746 PACKAGE_TARNAME='unbound'
747 PACKAGE_VERSION='1.4.3'
748 PACKAGE_STRING='unbound 1.4.3'
747 PACKAGE_VERSION='1.4.4'
748 PACKAGE_STRING='unbound 1.4.4'
749749 PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl'
750750
751751 # Factoring default headers for most tests.
792792 UB_ON_WINDOWS
793793 CHECKLOCK_SRC
794794 staticexe
795 RUNTIME_PATH
796795 HAVE_SSL
797796 WITH_PYUNBOUND
798797 WITH_PYTHONMODULE
810809 PTHREAD_LIBS
811810 PTHREAD_CC
812811 acx_pthread_config
812 RUNTIME_PATH
813813 LIBOBJS
814814 OTOOL64
815815 OTOOL
920920 with_gnu_ld
921921 enable_libtool_lock
922922 enable_rpath
923 enable_largefile
923924 with_pthreads
924925 with_solaris_threads
925926 with_pyunbound
933934 enable_alloc_checks
934935 enable_alloc_lite
935936 enable_alloc_nonregional
936 enable_largefile
937937 with_ldns
938938 with_ldns_builtin
939939 '
15011501 # Omit some internal or obsolete options to make the list less imposing.
15021502 # This message is too long to be a string in the A/UX 3.1 sh.
15031503 cat <<_ACEOF
1504 \`configure' configures unbound 1.4.3 to adapt to many kinds of systems.
1504 \`configure' configures unbound 1.4.4 to adapt to many kinds of systems.
15051505
15061506 Usage: $0 [OPTION]... [VAR=VALUE]...
15071507
15661566
15671567 if test -n "$ac_init_help"; then
15681568 case $ac_init_help in
1569 short | recursive ) echo "Configuration of unbound 1.4.3:";;
1569 short | recursive ) echo "Configuration of unbound 1.4.4:";;
15701570 esac
15711571 cat <<\_ACEOF
15721572
15821582 optimize for fast installation [default=yes]
15831583 --disable-libtool-lock avoid locking (might break parallel builds)
15841584 --disable-rpath disable hardcoded rpath (default=enabled)
1585 --disable-largefile omit support for large files
15851586 --disable-sha2 Disable SHA256 and SHA512 RRSIG support
15861587 --enable-gost Enable GOST support, experimental
15871588 --enable-static-exe enable to compile executables statically against
15961597 enable nonregional allocs, slow but exposes regional
15971598 allocations to other memory purifiers, for debug
15981599 purposes
1599 --disable-largefile omit support for large files
16001600
16011601 Optional Packages:
16021602 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
17181718 test -n "$ac_init_help" && exit $ac_status
17191719 if $ac_init_version; then
17201720 cat <<\_ACEOF
1721 unbound configure 1.4.3
1721 unbound configure 1.4.4
17221722 generated by GNU Autoconf 2.63
17231723
17241724 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
17321732 This file contains any messages produced by compilers while
17331733 running configure, to aid debugging if configure makes a mistake.
17341734
1735 It was created by unbound $as_me 1.4.3, which was
1735 It was created by unbound $as_me 1.4.4, which was
17361736 generated by GNU Autoconf 2.63. Invocation command line was
17371737
17381738 $ $0 $@
21022102
21032103
21042104 LIBUNBOUND_CURRENT=2
2105 LIBUNBOUND_REVISION=3
2105 LIBUNBOUND_REVISION=4
21062106 LIBUNBOUND_AGE=0
21072107 # 1.0.0 had 0:12:0
21082108 # 1.0.1 had 0:13:0
21212121 # 1.4.1 had 2:1:0
21222122 # 1.4.2 had 2:2:0
21232123 # 1.4.3 had 2:3:0
2124 # 1.4.4 had 2:4:0
21242125
21252126 # Current -- the number of the binary API that we're implementing
21262127 # Revision -- which iteration of the implementation of the binary
72977298 else
72987299 lt_cv_nm_interface="BSD nm"
72997300 echo "int some_variable = 0;" > conftest.$ac_ext
7300 (eval echo "\"\$as_me:7301: $ac_compile\"" >&5)
7301 (eval echo "\"\$as_me:7302: $ac_compile\"" >&5)
73017302 (eval "$ac_compile" 2>conftest.err)
73027303 cat conftest.err >&5
7303 (eval echo "\"\$as_me:7304: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
7304 (eval echo "\"\$as_me:7305: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
73047305 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
73057306 cat conftest.err >&5
7306 (eval echo "\"\$as_me:7307: output\"" >&5)
7307 (eval echo "\"\$as_me:7308: output\"" >&5)
73077308 cat conftest.out >&5
73087309 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
73097310 lt_cv_nm_interface="MS dumpbin"
85088509 ;;
85098510 *-*-irix6*)
85108511 # Find out which ABI we are using.
8511 echo '#line 8512 "configure"' > conftest.$ac_ext
8512 echo '#line 8513 "configure"' > conftest.$ac_ext
85128513 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
85138514 (eval $ac_compile) 2>&5
85148515 ac_status=$?
98759876 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
98769877 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
98779878 -e 's:$: $lt_compiler_flag:'`
9878 (eval echo "\"\$as_me:9879: $lt_compile\"" >&5)
9879 (eval echo "\"\$as_me:9880: $lt_compile\"" >&5)
98799880 (eval "$lt_compile" 2>conftest.err)
98809881 ac_status=$?
98819882 cat conftest.err >&5
9882 echo "$as_me:9883: \$? = $ac_status" >&5
9883 echo "$as_me:9884: \$? = $ac_status" >&5
98839884 if (exit $ac_status) && test -s "$ac_outfile"; then
98849885 # The compiler can only warn and ignore the option if not recognized
98859886 # So say no if there are warnings other than the usual output.
1021410215 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1021510216 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1021610217 -e 's:$: $lt_compiler_flag:'`
10217 (eval echo "\"\$as_me:10218: $lt_compile\"" >&5)
10218 (eval echo "\"\$as_me:10219: $lt_compile\"" >&5)
1021810219 (eval "$lt_compile" 2>conftest.err)
1021910220 ac_status=$?
1022010221 cat conftest.err >&5
10221 echo "$as_me:10222: \$? = $ac_status" >&5
10222 echo "$as_me:10223: \$? = $ac_status" >&5
1022210223 if (exit $ac_status) && test -s "$ac_outfile"; then
1022310224 # The compiler can only warn and ignore the option if not recognized
1022410225 # So say no if there are warnings other than the usual output.
1031910320 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1032010321 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1032110322 -e 's:$: $lt_compiler_flag:'`
10322 (eval echo "\"\$as_me:10323: $lt_compile\"" >&5)
10323 (eval echo "\"\$as_me:10324: $lt_compile\"" >&5)
1032310324 (eval "$lt_compile" 2>out/conftest.err)
1032410325 ac_status=$?
1032510326 cat out/conftest.err >&5
10326 echo "$as_me:10327: \$? = $ac_status" >&5
10327 echo "$as_me:10328: \$? = $ac_status" >&5
1032710328 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1032810329 then
1032910330 # The compiler can only warn and ignore the option if not recognized
1037410375 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1037510376 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1037610377 -e 's:$: $lt_compiler_flag:'`
10377 (eval echo "\"\$as_me:10378: $lt_compile\"" >&5)
10378 (eval echo "\"\$as_me:10379: $lt_compile\"" >&5)
1037810379 (eval "$lt_compile" 2>out/conftest.err)
1037910380 ac_status=$?
1038010381 cat out/conftest.err >&5
10381 echo "$as_me:10382: \$? = $ac_status" >&5
10382 echo "$as_me:10383: \$? = $ac_status" >&5
1038210383 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1038310384 then
1038410385 # The compiler can only warn and ignore the option if not recognized
1317713178 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1317813179 lt_status=$lt_dlunknown
1317913180 cat > conftest.$ac_ext <<_LT_EOF
13180 #line 13181 "configure"
13181 #line 13182 "configure"
1318113182 #include "confdefs.h"
1318213183
1318313184 #if HAVE_DLFCN_H
1327313274 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1327413275 lt_status=$lt_dlunknown
1327513276 cat > conftest.$ac_ext <<_LT_EOF
13276 #line 13277 "configure"
13277 #line 13278 "configure"
1327713278 #include "confdefs.h"
1327813279
1327913280 #if HAVE_DLFCN_H
1557215573 fi
1557315574
1557415575
15576
15577 # check to see if libraries are needed for these functions.
15578 { $as_echo "$as_me:$LINENO: checking for library containing inet_pton" >&5
15579 $as_echo_n "checking for library containing inet_pton... " >&6; }
15580 if test "${ac_cv_search_inet_pton+set}" = set; then
15581 $as_echo_n "(cached) " >&6
15582 else
15583 ac_func_search_save_LIBS=$LIBS
15584 cat >conftest.$ac_ext <<_ACEOF
15585 /* confdefs.h. */
15586 _ACEOF
15587 cat confdefs.h >>conftest.$ac_ext
15588 cat >>conftest.$ac_ext <<_ACEOF
15589 /* end confdefs.h. */
15590
15591 /* Override any GCC internal prototype to avoid an error.
15592 Use char because int might match the return type of a GCC
15593 builtin and then its argument prototype would still apply. */
15594 #ifdef __cplusplus
15595 extern "C"
15596 #endif
15597 char inet_pton ();
15598 int
15599 main ()
15600 {
15601 return inet_pton ();
15602 ;
15603 return 0;
15604 }
15605 _ACEOF
15606 for ac_lib in '' nsl; do
15607 if test -z "$ac_lib"; then
15608 ac_res="none required"
15609 else
15610 ac_res=-l$ac_lib
15611 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15612 fi
15613 rm -f conftest.$ac_objext conftest$ac_exeext
15614 if { (ac_try="$ac_link"
15615 case "(($ac_try" in
15616 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15617 *) ac_try_echo=$ac_try;;
15618 esac
15619 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15620 $as_echo "$ac_try_echo") >&5
15621 (eval "$ac_link") 2>conftest.er1
15622 ac_status=$?
15623 grep -v '^ *+' conftest.er1 >conftest.err
15624 rm -f conftest.er1
15625 cat conftest.err >&5
15626 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15627 (exit $ac_status); } && {
15628 test -z "$ac_c_werror_flag" ||
15629 test ! -s conftest.err
15630 } && test -s conftest$ac_exeext && {
15631 test "$cross_compiling" = yes ||
15632 $as_test_x conftest$ac_exeext
15633 }; then
15634 ac_cv_search_inet_pton=$ac_res
15635 else
15636 $as_echo "$as_me: failed program was:" >&5
15637 sed 's/^/| /' conftest.$ac_ext >&5
15638
15639
15640 fi
15641
15642 rm -rf conftest.dSYM
15643 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
15644 conftest$ac_exeext
15645 if test "${ac_cv_search_inet_pton+set}" = set; then
15646 break
15647 fi
15648 done
15649 if test "${ac_cv_search_inet_pton+set}" = set; then
15650 :
15651 else
15652 ac_cv_search_inet_pton=no
15653 fi
15654 rm conftest.$ac_ext
15655 LIBS=$ac_func_search_save_LIBS
15656 fi
15657 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_inet_pton" >&5
15658 $as_echo "$ac_cv_search_inet_pton" >&6; }
15659 ac_res=$ac_cv_search_inet_pton
15660 if test "$ac_res" != no; then
15661 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15662
15663 fi
15664
15665 { $as_echo "$as_me:$LINENO: checking for library containing socket" >&5
15666 $as_echo_n "checking for library containing socket... " >&6; }
15667 if test "${ac_cv_search_socket+set}" = set; then
15668 $as_echo_n "(cached) " >&6
15669 else
15670 ac_func_search_save_LIBS=$LIBS
15671 cat >conftest.$ac_ext <<_ACEOF
15672 /* confdefs.h. */
15673 _ACEOF
15674 cat confdefs.h >>conftest.$ac_ext
15675 cat >>conftest.$ac_ext <<_ACEOF
15676 /* end confdefs.h. */
15677
15678 /* Override any GCC internal prototype to avoid an error.
15679 Use char because int might match the return type of a GCC
15680 builtin and then its argument prototype would still apply. */
15681 #ifdef __cplusplus
15682 extern "C"
15683 #endif
15684 char socket ();
15685 int
15686 main ()
15687 {
15688 return socket ();
15689 ;
15690 return 0;
15691 }
15692 _ACEOF
15693 for ac_lib in '' socket; do
15694 if test -z "$ac_lib"; then
15695 ac_res="none required"
15696 else
15697 ac_res=-l$ac_lib
15698 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
15699 fi
15700 rm -f conftest.$ac_objext conftest$ac_exeext
15701 if { (ac_try="$ac_link"
15702 case "(($ac_try" in
15703 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15704 *) ac_try_echo=$ac_try;;
15705 esac
15706 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15707 $as_echo "$ac_try_echo") >&5
15708 (eval "$ac_link") 2>conftest.er1
15709 ac_status=$?
15710 grep -v '^ *+' conftest.er1 >conftest.err
15711 rm -f conftest.er1
15712 cat conftest.err >&5
15713 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15714 (exit $ac_status); } && {
15715 test -z "$ac_c_werror_flag" ||
15716 test ! -s conftest.err
15717 } && test -s conftest$ac_exeext && {
15718 test "$cross_compiling" = yes ||
15719 $as_test_x conftest$ac_exeext
15720 }; then
15721 ac_cv_search_socket=$ac_res
15722 else
15723 $as_echo "$as_me: failed program was:" >&5
15724 sed 's/^/| /' conftest.$ac_ext >&5
15725
15726
15727 fi
15728
15729 rm -rf conftest.dSYM
15730 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
15731 conftest$ac_exeext
15732 if test "${ac_cv_search_socket+set}" = set; then
15733 break
15734 fi
15735 done
15736 if test "${ac_cv_search_socket+set}" = set; then
15737 :
15738 else
15739 ac_cv_search_socket=no
15740 fi
15741 rm conftest.$ac_ext
15742 LIBS=$ac_func_search_save_LIBS
15743 fi
15744 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
15745 $as_echo "$ac_cv_search_socket" >&6; }
15746 ac_res=$ac_cv_search_socket
15747 if test "$ac_res" != no; then
15748 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15749
15750 fi
15751
15752
15753 # check some functions of the OS before linking libs (while still runnable).
15754
15755 for ac_header in unistd.h
15756 do
15757 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15758 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15759 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15760 $as_echo_n "checking for $ac_header... " >&6; }
15761 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15762 $as_echo_n "(cached) " >&6
15763 fi
15764 ac_res=`eval 'as_val=${'$as_ac_Header'}
15765 $as_echo "$as_val"'`
15766 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15767 $as_echo "$ac_res" >&6; }
15768 else
15769 # Is the header compilable?
15770 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
15771 $as_echo_n "checking $ac_header usability... " >&6; }
15772 cat >conftest.$ac_ext <<_ACEOF
15773 /* confdefs.h. */
15774 _ACEOF
15775 cat confdefs.h >>conftest.$ac_ext
15776 cat >>conftest.$ac_ext <<_ACEOF
15777 /* end confdefs.h. */
15778 $ac_includes_default
15779 #include <$ac_header>
15780 _ACEOF
15781 rm -f conftest.$ac_objext
15782 if { (ac_try="$ac_compile"
15783 case "(($ac_try" in
15784 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15785 *) ac_try_echo=$ac_try;;
15786 esac
15787 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15788 $as_echo "$ac_try_echo") >&5
15789 (eval "$ac_compile") 2>conftest.er1
15790 ac_status=$?
15791 grep -v '^ *+' conftest.er1 >conftest.err
15792 rm -f conftest.er1
15793 cat conftest.err >&5
15794 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15795 (exit $ac_status); } && {
15796 test -z "$ac_c_werror_flag" ||
15797 test ! -s conftest.err
15798 } && test -s conftest.$ac_objext; then
15799 ac_header_compiler=yes
15800 else
15801 $as_echo "$as_me: failed program was:" >&5
15802 sed 's/^/| /' conftest.$ac_ext >&5
15803
15804 ac_header_compiler=no
15805 fi
15806
15807 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15808 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
15809 $as_echo "$ac_header_compiler" >&6; }
15810
15811 # Is the header present?
15812 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
15813 $as_echo_n "checking $ac_header presence... " >&6; }
15814 cat >conftest.$ac_ext <<_ACEOF
15815 /* confdefs.h. */
15816 _ACEOF
15817 cat confdefs.h >>conftest.$ac_ext
15818 cat >>conftest.$ac_ext <<_ACEOF
15819 /* end confdefs.h. */
15820 #include <$ac_header>
15821 _ACEOF
15822 if { (ac_try="$ac_cpp conftest.$ac_ext"
15823 case "(($ac_try" in
15824 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15825 *) ac_try_echo=$ac_try;;
15826 esac
15827 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15828 $as_echo "$ac_try_echo") >&5
15829 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
15830 ac_status=$?
15831 grep -v '^ *+' conftest.er1 >conftest.err
15832 rm -f conftest.er1
15833 cat conftest.err >&5
15834 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15835 (exit $ac_status); } >/dev/null && {
15836 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
15837 test ! -s conftest.err
15838 }; then
15839 ac_header_preproc=yes
15840 else
15841 $as_echo "$as_me: failed program was:" >&5
15842 sed 's/^/| /' conftest.$ac_ext >&5
15843
15844 ac_header_preproc=no
15845 fi
15846
15847 rm -f conftest.err conftest.$ac_ext
15848 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
15849 $as_echo "$ac_header_preproc" >&6; }
15850
15851 # So? What about this header?
15852 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
15853 yes:no: )
15854 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
15855 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
15856 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
15857 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
15858 ac_header_preproc=yes
15859 ;;
15860 no:yes:* )
15861 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
15862 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
15863 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
15864 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
15865 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
15866 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
15867 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
15868 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
15869 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
15870 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
15871 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
15872 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
15873 ( cat <<\_ASBOX
15874 ## ---------------------------------------- ##
15875 ## Report this to unbound-bugs@nlnetlabs.nl ##
15876 ## ---------------------------------------- ##
15877 _ASBOX
15878 ) | sed "s/^/$as_me: WARNING: /" >&2
15879 ;;
15880 esac
15881 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15882 $as_echo_n "checking for $ac_header... " >&6; }
15883 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15884 $as_echo_n "(cached) " >&6
15885 else
15886 eval "$as_ac_Header=\$ac_header_preproc"
15887 fi
15888 ac_res=`eval 'as_val=${'$as_ac_Header'}
15889 $as_echo "$as_val"'`
15890 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
15891 $as_echo "$ac_res" >&6; }
15892
15893 fi
15894 as_val=`eval 'as_val=${'$as_ac_Header'}
15895 $as_echo "$as_val"'`
15896 if test "x$as_val" = x""yes; then
15897 cat >>confdefs.h <<_ACEOF
15898 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
15899 _ACEOF
15900
15901 fi
15902
15903 done
15904
15905 { $as_echo "$as_me:$LINENO: checking for working chown" >&5
15906 $as_echo_n "checking for working chown... " >&6; }
15907 if test "${ac_cv_func_chown_works+set}" = set; then
15908 $as_echo_n "(cached) " >&6
15909 else
15910 if test "$cross_compiling" = yes; then
15911 ac_cv_func_chown_works=no
15912 else
15913 cat >conftest.$ac_ext <<_ACEOF
15914 /* confdefs.h. */
15915 _ACEOF
15916 cat confdefs.h >>conftest.$ac_ext
15917 cat >>conftest.$ac_ext <<_ACEOF
15918 /* end confdefs.h. */
15919 $ac_includes_default
15920 #include <fcntl.h>
15921
15922 int
15923 main ()
15924 {
15925 char *f = "conftest.chown";
15926 struct stat before, after;
15927
15928 if (creat (f, 0600) < 0)
15929 return 1;
15930 if (stat (f, &before) < 0)
15931 return 1;
15932 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
15933 return 1;
15934 if (stat (f, &after) < 0)
15935 return 1;
15936 return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
15937
15938 ;
15939 return 0;
15940 }
15941 _ACEOF
15942 rm -f conftest$ac_exeext
15943 if { (ac_try="$ac_link"
15944 case "(($ac_try" in
15945 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15946 *) ac_try_echo=$ac_try;;
15947 esac
15948 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15949 $as_echo "$ac_try_echo") >&5
15950 (eval "$ac_link") 2>&5
15951 ac_status=$?
15952 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15953 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15954 { (case "(($ac_try" in
15955 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15956 *) ac_try_echo=$ac_try;;
15957 esac
15958 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
15959 $as_echo "$ac_try_echo") >&5
15960 (eval "$ac_try") 2>&5
15961 ac_status=$?
15962 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
15963 (exit $ac_status); }; }; then
15964 ac_cv_func_chown_works=yes
15965 else
15966 $as_echo "$as_me: program exited with status $ac_status" >&5
15967 $as_echo "$as_me: failed program was:" >&5
15968 sed 's/^/| /' conftest.$ac_ext >&5
15969
15970 ( exit $ac_status )
15971 ac_cv_func_chown_works=no
15972 fi
15973 rm -rf conftest.dSYM
15974 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15975 fi
15976
15977
15978 rm -f conftest.chown
15979
15980 fi
15981 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_chown_works" >&5
15982 $as_echo "$ac_cv_func_chown_works" >&6; }
15983 if test $ac_cv_func_chown_works = yes; then
15984
15985 cat >>confdefs.h <<\_ACEOF
15986 #define HAVE_CHOWN 1
15987 _ACEOF
15988
15989 fi
15990
15991
15992 for ac_header in vfork.h
15993 do
15994 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
15995 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15996 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
15997 $as_echo_n "checking for $ac_header... " >&6; }
15998 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
15999 $as_echo_n "(cached) " >&6
16000 fi
16001 ac_res=`eval 'as_val=${'$as_ac_Header'}
16002 $as_echo "$as_val"'`
16003 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16004 $as_echo "$ac_res" >&6; }
16005 else
16006 # Is the header compilable?
16007 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
16008 $as_echo_n "checking $ac_header usability... " >&6; }
16009 cat >conftest.$ac_ext <<_ACEOF
16010 /* confdefs.h. */
16011 _ACEOF
16012 cat confdefs.h >>conftest.$ac_ext
16013 cat >>conftest.$ac_ext <<_ACEOF
16014 /* end confdefs.h. */
16015 $ac_includes_default
16016 #include <$ac_header>
16017 _ACEOF
16018 rm -f conftest.$ac_objext
16019 if { (ac_try="$ac_compile"
16020 case "(($ac_try" in
16021 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16022 *) ac_try_echo=$ac_try;;
16023 esac
16024 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16025 $as_echo "$ac_try_echo") >&5
16026 (eval "$ac_compile") 2>conftest.er1
16027 ac_status=$?
16028 grep -v '^ *+' conftest.er1 >conftest.err
16029 rm -f conftest.er1
16030 cat conftest.err >&5
16031 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16032 (exit $ac_status); } && {
16033 test -z "$ac_c_werror_flag" ||
16034 test ! -s conftest.err
16035 } && test -s conftest.$ac_objext; then
16036 ac_header_compiler=yes
16037 else
16038 $as_echo "$as_me: failed program was:" >&5
16039 sed 's/^/| /' conftest.$ac_ext >&5
16040
16041 ac_header_compiler=no
16042 fi
16043
16044 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16045 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
16046 $as_echo "$ac_header_compiler" >&6; }
16047
16048 # Is the header present?
16049 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
16050 $as_echo_n "checking $ac_header presence... " >&6; }
16051 cat >conftest.$ac_ext <<_ACEOF
16052 /* confdefs.h. */
16053 _ACEOF
16054 cat confdefs.h >>conftest.$ac_ext
16055 cat >>conftest.$ac_ext <<_ACEOF
16056 /* end confdefs.h. */
16057 #include <$ac_header>
16058 _ACEOF
16059 if { (ac_try="$ac_cpp conftest.$ac_ext"
16060 case "(($ac_try" in
16061 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16062 *) ac_try_echo=$ac_try;;
16063 esac
16064 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16065 $as_echo "$ac_try_echo") >&5
16066 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16067 ac_status=$?
16068 grep -v '^ *+' conftest.er1 >conftest.err
16069 rm -f conftest.er1
16070 cat conftest.err >&5
16071 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16072 (exit $ac_status); } >/dev/null && {
16073 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
16074 test ! -s conftest.err
16075 }; then
16076 ac_header_preproc=yes
16077 else
16078 $as_echo "$as_me: failed program was:" >&5
16079 sed 's/^/| /' conftest.$ac_ext >&5
16080
16081 ac_header_preproc=no
16082 fi
16083
16084 rm -f conftest.err conftest.$ac_ext
16085 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
16086 $as_echo "$ac_header_preproc" >&6; }
16087
16088 # So? What about this header?
16089 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
16090 yes:no: )
16091 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
16092 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16093 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
16094 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
16095 ac_header_preproc=yes
16096 ;;
16097 no:yes:* )
16098 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
16099 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
16100 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
16101 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
16102 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
16103 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
16104 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
16105 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
16106 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16107 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16108 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
16109 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
16110 ( cat <<\_ASBOX
16111 ## ---------------------------------------- ##
16112 ## Report this to unbound-bugs@nlnetlabs.nl ##
16113 ## ---------------------------------------- ##
16114 _ASBOX
16115 ) | sed "s/^/$as_me: WARNING: /" >&2
16116 ;;
16117 esac
16118 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
16119 $as_echo_n "checking for $ac_header... " >&6; }
16120 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
16121 $as_echo_n "(cached) " >&6
16122 else
16123 eval "$as_ac_Header=\$ac_header_preproc"
16124 fi
16125 ac_res=`eval 'as_val=${'$as_ac_Header'}
16126 $as_echo "$as_val"'`
16127 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16128 $as_echo "$ac_res" >&6; }
16129
16130 fi
16131 as_val=`eval 'as_val=${'$as_ac_Header'}
16132 $as_echo "$as_val"'`
16133 if test "x$as_val" = x""yes; then
16134 cat >>confdefs.h <<_ACEOF
16135 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
16136 _ACEOF
16137
16138 fi
16139
16140 done
16141
16142
16143
16144 for ac_func in fork vfork
16145 do
16146 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16147 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
16148 $as_echo_n "checking for $ac_func... " >&6; }
16149 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
16150 $as_echo_n "(cached) " >&6
16151 else
16152 cat >conftest.$ac_ext <<_ACEOF
16153 /* confdefs.h. */
16154 _ACEOF
16155 cat confdefs.h >>conftest.$ac_ext
16156 cat >>conftest.$ac_ext <<_ACEOF
16157 /* end confdefs.h. */
16158 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
16159 For example, HP-UX 11i <limits.h> declares gettimeofday. */
16160 #define $ac_func innocuous_$ac_func
16161
16162 /* System header to define __stub macros and hopefully few prototypes,
16163 which can conflict with char $ac_func (); below.
16164 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
16165 <limits.h> exists even on freestanding compilers. */
16166
16167 #ifdef __STDC__
16168 # include <limits.h>
16169 #else
16170 # include <assert.h>
16171 #endif
16172
16173 #undef $ac_func
16174
16175 /* Override any GCC internal prototype to avoid an error.
16176 Use char because int might match the return type of a GCC
16177 builtin and then its argument prototype would still apply. */
16178 #ifdef __cplusplus
16179 extern "C"
16180 #endif
16181 char $ac_func ();
16182 /* The GNU C library defines this for functions which it implements
16183 to always fail with ENOSYS. Some functions are actually named
16184 something starting with __ and the normal name is an alias. */
16185 #if defined __stub_$ac_func || defined __stub___$ac_func
16186 choke me
16187 #endif
16188
16189 int
16190 main ()
16191 {
16192 return $ac_func ();
16193 ;
16194 return 0;
16195 }
16196 _ACEOF
16197 rm -f conftest.$ac_objext conftest$ac_exeext
16198 if { (ac_try="$ac_link"
16199 case "(($ac_try" in
16200 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16201 *) ac_try_echo=$ac_try;;
16202 esac
16203 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16204 $as_echo "$ac_try_echo") >&5
16205 (eval "$ac_link") 2>conftest.er1
16206 ac_status=$?
16207 grep -v '^ *+' conftest.er1 >conftest.err
16208 rm -f conftest.er1
16209 cat conftest.err >&5
16210 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16211 (exit $ac_status); } && {
16212 test -z "$ac_c_werror_flag" ||
16213 test ! -s conftest.err
16214 } && test -s conftest$ac_exeext && {
16215 test "$cross_compiling" = yes ||
16216 $as_test_x conftest$ac_exeext
16217 }; then
16218 eval "$as_ac_var=yes"
16219 else
16220 $as_echo "$as_me: failed program was:" >&5
16221 sed 's/^/| /' conftest.$ac_ext >&5
16222
16223 eval "$as_ac_var=no"
16224 fi
16225
16226 rm -rf conftest.dSYM
16227 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16228 conftest$ac_exeext conftest.$ac_ext
16229 fi
16230 ac_res=`eval 'as_val=${'$as_ac_var'}
16231 $as_echo "$as_val"'`
16232 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
16233 $as_echo "$ac_res" >&6; }
16234 as_val=`eval 'as_val=${'$as_ac_var'}
16235 $as_echo "$as_val"'`
16236 if test "x$as_val" = x""yes; then
16237 cat >>confdefs.h <<_ACEOF
16238 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16239 _ACEOF
16240
16241 fi
16242 done
16243
16244 if test "x$ac_cv_func_fork" = xyes; then
16245 { $as_echo "$as_me:$LINENO: checking for working fork" >&5
16246 $as_echo_n "checking for working fork... " >&6; }
16247 if test "${ac_cv_func_fork_works+set}" = set; then
16248 $as_echo_n "(cached) " >&6
16249 else
16250 if test "$cross_compiling" = yes; then
16251 ac_cv_func_fork_works=cross
16252 else
16253 cat >conftest.$ac_ext <<_ACEOF
16254 /* confdefs.h. */
16255 _ACEOF
16256 cat confdefs.h >>conftest.$ac_ext
16257 cat >>conftest.$ac_ext <<_ACEOF
16258 /* end confdefs.h. */
16259 $ac_includes_default
16260 int
16261 main ()
16262 {
16263
16264 /* By Ruediger Kuhlmann. */
16265 return fork () < 0;
16266
16267 ;
16268 return 0;
16269 }
16270 _ACEOF
16271 rm -f conftest$ac_exeext
16272 if { (ac_try="$ac_link"
16273 case "(($ac_try" in
16274 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16275 *) ac_try_echo=$ac_try;;
16276 esac
16277 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16278 $as_echo "$ac_try_echo") >&5
16279 (eval "$ac_link") 2>&5
16280 ac_status=$?
16281 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16282 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16283 { (case "(($ac_try" in
16284 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16285 *) ac_try_echo=$ac_try;;
16286 esac
16287 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16288 $as_echo "$ac_try_echo") >&5
16289 (eval "$ac_try") 2>&5
16290 ac_status=$?
16291 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16292 (exit $ac_status); }; }; then
16293 ac_cv_func_fork_works=yes
16294 else
16295 $as_echo "$as_me: program exited with status $ac_status" >&5
16296 $as_echo "$as_me: failed program was:" >&5
16297 sed 's/^/| /' conftest.$ac_ext >&5
16298
16299 ( exit $ac_status )
16300 ac_cv_func_fork_works=no
16301 fi
16302 rm -rf conftest.dSYM
16303 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16304 fi
16305
16306
16307 fi
16308 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
16309 $as_echo "$ac_cv_func_fork_works" >&6; }
16310
16311 else
16312 ac_cv_func_fork_works=$ac_cv_func_fork
16313 fi
16314 if test "x$ac_cv_func_fork_works" = xcross; then
16315 case $host in
16316 *-*-amigaos* | *-*-msdosdjgpp*)
16317 # Override, as these systems have only a dummy fork() stub
16318 ac_cv_func_fork_works=no
16319 ;;
16320 *)
16321 ac_cv_func_fork_works=yes
16322 ;;
16323 esac
16324 { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
16325 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
16326 fi
16327 ac_cv_func_vfork_works=$ac_cv_func_vfork
16328 if test "x$ac_cv_func_vfork" = xyes; then
16329 { $as_echo "$as_me:$LINENO: checking for working vfork" >&5
16330 $as_echo_n "checking for working vfork... " >&6; }
16331 if test "${ac_cv_func_vfork_works+set}" = set; then
16332 $as_echo_n "(cached) " >&6
16333 else
16334 if test "$cross_compiling" = yes; then
16335 ac_cv_func_vfork_works=cross
16336 else
16337 cat >conftest.$ac_ext <<_ACEOF
16338 /* confdefs.h. */
16339 _ACEOF
16340 cat confdefs.h >>conftest.$ac_ext
16341 cat >>conftest.$ac_ext <<_ACEOF
16342 /* end confdefs.h. */
16343 /* Thanks to Paul Eggert for this test. */
16344 $ac_includes_default
16345 #include <sys/wait.h>
16346 #ifdef HAVE_VFORK_H
16347 # include <vfork.h>
16348 #endif
16349 /* On some sparc systems, changes by the child to local and incoming
16350 argument registers are propagated back to the parent. The compiler
16351 is told about this with #include <vfork.h>, but some compilers
16352 (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
16353 static variable whose address is put into a register that is
16354 clobbered by the vfork. */
16355 static void
16356 #ifdef __cplusplus
16357 sparc_address_test (int arg)
16358 # else
16359 sparc_address_test (arg) int arg;
16360 #endif
16361 {
16362 static pid_t child;
16363 if (!child) {
16364 child = vfork ();
16365 if (child < 0) {
16366 perror ("vfork");
16367 _exit(2);
16368 }
16369 if (!child) {
16370 arg = getpid();
16371 write(-1, "", 0);
16372 _exit (arg);
16373 }
16374 }
16375 }
16376
16377 int
16378 main ()
16379 {
16380 pid_t parent = getpid ();
16381 pid_t child;
16382
16383 sparc_address_test (0);
16384
16385 child = vfork ();
16386
16387 if (child == 0) {
16388 /* Here is another test for sparc vfork register problems. This
16389 test uses lots of local variables, at least as many local
16390 variables as main has allocated so far including compiler
16391 temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
16392 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
16393 reuse the register of parent for one of the local variables,
16394 since it will think that parent can't possibly be used any more
16395 in this routine. Assigning to the local variable will thus
16396 munge parent in the parent process. */
16397 pid_t
16398 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
16399 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
16400 /* Convince the compiler that p..p7 are live; otherwise, it might
16401 use the same hardware register for all 8 local variables. */
16402 if (p != p1 || p != p2 || p != p3 || p != p4
16403 || p != p5 || p != p6 || p != p7)
16404 _exit(1);
16405
16406 /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
16407 from child file descriptors. If the child closes a descriptor
16408 before it execs or exits, this munges the parent's descriptor
16409 as well. Test for this by closing stdout in the child. */
16410 _exit(close(fileno(stdout)) != 0);
16411 } else {
16412 int status;
16413 struct stat st;
16414
16415 while (wait(&status) != child)
16416 ;
16417 return (
16418 /* Was there some problem with vforking? */
16419 child < 0
16420
16421 /* Did the child fail? (This shouldn't happen.) */
16422 || status
16423
16424 /* Did the vfork/compiler bug occur? */
16425 || parent != getpid()
16426
16427 /* Did the file descriptor bug occur? */
16428 || fstat(fileno(stdout), &st) != 0
16429 );
16430 }
16431 }
16432 _ACEOF
16433 rm -f conftest$ac_exeext
16434 if { (ac_try="$ac_link"
16435 case "(($ac_try" in
16436 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16437 *) ac_try_echo=$ac_try;;
16438 esac
16439 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16440 $as_echo "$ac_try_echo") >&5
16441 (eval "$ac_link") 2>&5
16442 ac_status=$?
16443 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16444 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16445 { (case "(($ac_try" in
16446 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16447 *) ac_try_echo=$ac_try;;
16448 esac
16449 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16450 $as_echo "$ac_try_echo") >&5
16451 (eval "$ac_try") 2>&5
16452 ac_status=$?
16453 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16454 (exit $ac_status); }; }; then
16455 ac_cv_func_vfork_works=yes
16456 else
16457 $as_echo "$as_me: program exited with status $ac_status" >&5
16458 $as_echo "$as_me: failed program was:" >&5
16459 sed 's/^/| /' conftest.$ac_ext >&5
16460
16461 ( exit $ac_status )
16462 ac_cv_func_vfork_works=no
16463 fi
16464 rm -rf conftest.dSYM
16465 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16466 fi
16467
16468
16469 fi
16470 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
16471 $as_echo "$ac_cv_func_vfork_works" >&6; }
16472
16473 fi;
16474 if test "x$ac_cv_func_fork_works" = xcross; then
16475 ac_cv_func_vfork_works=$ac_cv_func_vfork
16476 { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
16477 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
16478 fi
16479
16480 if test "x$ac_cv_func_vfork_works" = xyes; then
16481
16482 cat >>confdefs.h <<\_ACEOF
16483 #define HAVE_WORKING_VFORK 1
16484 _ACEOF
16485
16486 else
16487
16488 cat >>confdefs.h <<\_ACEOF
16489 #define vfork fork
16490 _ACEOF
16491
16492 fi
16493 if test "x$ac_cv_func_fork_works" = xyes; then
16494
16495 cat >>confdefs.h <<\_ACEOF
16496 #define HAVE_WORKING_FORK 1
16497 _ACEOF
16498
16499 fi
16500
16501 { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
16502 $as_echo_n "checking return type of signal handlers... " >&6; }
16503 if test "${ac_cv_type_signal+set}" = set; then
16504 $as_echo_n "(cached) " >&6
16505 else
16506 cat >conftest.$ac_ext <<_ACEOF
16507 /* confdefs.h. */
16508 _ACEOF
16509 cat confdefs.h >>conftest.$ac_ext
16510 cat >>conftest.$ac_ext <<_ACEOF
16511 /* end confdefs.h. */
16512 #include <sys/types.h>
16513 #include <signal.h>
16514
16515 int
16516 main ()
16517 {
16518 return *(signal (0, 0)) (0) == 1;
16519 ;
16520 return 0;
16521 }
16522 _ACEOF
16523 rm -f conftest.$ac_objext
16524 if { (ac_try="$ac_compile"
16525 case "(($ac_try" in
16526 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16527 *) ac_try_echo=$ac_try;;
16528 esac
16529 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16530 $as_echo "$ac_try_echo") >&5
16531 (eval "$ac_compile") 2>conftest.er1
16532 ac_status=$?
16533 grep -v '^ *+' conftest.er1 >conftest.err
16534 rm -f conftest.er1
16535 cat conftest.err >&5
16536 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16537 (exit $ac_status); } && {
16538 test -z "$ac_c_werror_flag" ||
16539 test ! -s conftest.err
16540 } && test -s conftest.$ac_objext; then
16541 ac_cv_type_signal=int
16542 else
16543 $as_echo "$as_me: failed program was:" >&5
16544 sed 's/^/| /' conftest.$ac_ext >&5
16545
16546 ac_cv_type_signal=void
16547 fi
16548
16549 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16550 fi
16551 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
16552 $as_echo "$ac_cv_type_signal" >&6; }
16553
16554 cat >>confdefs.h <<_ACEOF
16555 #define RETSIGTYPE $ac_cv_type_signal
16556 _ACEOF
16557
16558
16559 { $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
16560 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
16561 if test "${ac_cv_sys_largefile_source+set}" = set; then
16562 $as_echo_n "(cached) " >&6
16563 else
16564 while :; do
16565 cat >conftest.$ac_ext <<_ACEOF
16566 /* confdefs.h. */
16567 _ACEOF
16568 cat confdefs.h >>conftest.$ac_ext
16569 cat >>conftest.$ac_ext <<_ACEOF
16570 /* end confdefs.h. */
16571 #include <sys/types.h> /* for off_t */
16572 #include <stdio.h>
16573 int
16574 main ()
16575 {
16576 int (*fp) (FILE *, off_t, int) = fseeko;
16577 return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
16578 ;
16579 return 0;
16580 }
16581 _ACEOF
16582 rm -f conftest.$ac_objext conftest$ac_exeext
16583 if { (ac_try="$ac_link"
16584 case "(($ac_try" in
16585 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16586 *) ac_try_echo=$ac_try;;
16587 esac
16588 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16589 $as_echo "$ac_try_echo") >&5
16590 (eval "$ac_link") 2>conftest.er1
16591 ac_status=$?
16592 grep -v '^ *+' conftest.er1 >conftest.err
16593 rm -f conftest.er1
16594 cat conftest.err >&5
16595 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16596 (exit $ac_status); } && {
16597 test -z "$ac_c_werror_flag" ||
16598 test ! -s conftest.err
16599 } && test -s conftest$ac_exeext && {
16600 test "$cross_compiling" = yes ||
16601 $as_test_x conftest$ac_exeext
16602 }; then
16603 ac_cv_sys_largefile_source=no; break
16604 else
16605 $as_echo "$as_me: failed program was:" >&5
16606 sed 's/^/| /' conftest.$ac_ext >&5
16607
16608
16609 fi
16610
16611 rm -rf conftest.dSYM
16612 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16613 conftest$ac_exeext conftest.$ac_ext
16614 cat >conftest.$ac_ext <<_ACEOF
16615 /* confdefs.h. */
16616 _ACEOF
16617 cat confdefs.h >>conftest.$ac_ext
16618 cat >>conftest.$ac_ext <<_ACEOF
16619 /* end confdefs.h. */
16620 #define _LARGEFILE_SOURCE 1
16621 #include <sys/types.h> /* for off_t */
16622 #include <stdio.h>
16623 int
16624 main ()
16625 {
16626 int (*fp) (FILE *, off_t, int) = fseeko;
16627 return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
16628 ;
16629 return 0;
16630 }
16631 _ACEOF
16632 rm -f conftest.$ac_objext conftest$ac_exeext
16633 if { (ac_try="$ac_link"
16634 case "(($ac_try" in
16635 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16636 *) ac_try_echo=$ac_try;;
16637 esac
16638 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16639 $as_echo "$ac_try_echo") >&5
16640 (eval "$ac_link") 2>conftest.er1
16641 ac_status=$?
16642 grep -v '^ *+' conftest.er1 >conftest.err
16643 rm -f conftest.er1
16644 cat conftest.err >&5
16645 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16646 (exit $ac_status); } && {
16647 test -z "$ac_c_werror_flag" ||
16648 test ! -s conftest.err
16649 } && test -s conftest$ac_exeext && {
16650 test "$cross_compiling" = yes ||
16651 $as_test_x conftest$ac_exeext
16652 }; then
16653 ac_cv_sys_largefile_source=1; break
16654 else
16655 $as_echo "$as_me: failed program was:" >&5
16656 sed 's/^/| /' conftest.$ac_ext >&5
16657
16658
16659 fi
16660
16661 rm -rf conftest.dSYM
16662 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16663 conftest$ac_exeext conftest.$ac_ext
16664 ac_cv_sys_largefile_source=unknown
16665 break
16666 done
16667 fi
16668 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
16669 $as_echo "$ac_cv_sys_largefile_source" >&6; }
16670 case $ac_cv_sys_largefile_source in #(
16671 no | unknown) ;;
16672 *)
16673 cat >>confdefs.h <<_ACEOF
16674 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
16675 _ACEOF
16676 ;;
16677 esac
16678 rm -rf conftest*
16679
16680 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
16681 # in glibc 2.1.3, but that breaks too many other things.
16682 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
16683 if test $ac_cv_sys_largefile_source != unknown; then
16684
16685 cat >>confdefs.h <<\_ACEOF
16686 #define HAVE_FSEEKO 1
16687 _ACEOF
16688
16689 fi
16690
16691
16692 # Check whether --enable-largefile was given.
16693 if test "${enable_largefile+set}" = set; then
16694 enableval=$enable_largefile;
16695 fi
16696
16697 if test "$enable_largefile" != no; then
16698
16699 { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
16700 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
16701 if test "${ac_cv_sys_largefile_CC+set}" = set; then
16702 $as_echo_n "(cached) " >&6
16703 else
16704 ac_cv_sys_largefile_CC=no
16705 if test "$GCC" != yes; then
16706 ac_save_CC=$CC
16707 while :; do
16708 # IRIX 6.2 and later do not support large files by default,
16709 # so use the C compiler's -n32 option if that helps.
16710 cat >conftest.$ac_ext <<_ACEOF
16711 /* confdefs.h. */
16712 _ACEOF
16713 cat confdefs.h >>conftest.$ac_ext
16714 cat >>conftest.$ac_ext <<_ACEOF
16715 /* end confdefs.h. */
16716 #include <sys/types.h>
16717 /* Check that off_t can represent 2**63 - 1 correctly.
16718 We can't simply define LARGE_OFF_T to be 9223372036854775807,
16719 since some C++ compilers masquerading as C compilers
16720 incorrectly reject 9223372036854775807. */
16721 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
16722 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
16723 && LARGE_OFF_T % 2147483647 == 1)
16724 ? 1 : -1];
16725 int
16726 main ()
16727 {
16728
16729 ;
16730 return 0;
16731 }
16732 _ACEOF
16733 rm -f conftest.$ac_objext
16734 if { (ac_try="$ac_compile"
16735 case "(($ac_try" in
16736 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16737 *) ac_try_echo=$ac_try;;
16738 esac
16739 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16740 $as_echo "$ac_try_echo") >&5
16741 (eval "$ac_compile") 2>conftest.er1
16742 ac_status=$?
16743 grep -v '^ *+' conftest.er1 >conftest.err
16744 rm -f conftest.er1
16745 cat conftest.err >&5
16746 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16747 (exit $ac_status); } && {
16748 test -z "$ac_c_werror_flag" ||
16749 test ! -s conftest.err
16750 } && test -s conftest.$ac_objext; then
16751 break
16752 else
16753 $as_echo "$as_me: failed program was:" >&5
16754 sed 's/^/| /' conftest.$ac_ext >&5
16755
16756
16757 fi
16758
16759 rm -f core conftest.err conftest.$ac_objext
16760 CC="$CC -n32"
16761 rm -f conftest.$ac_objext
16762 if { (ac_try="$ac_compile"
16763 case "(($ac_try" in
16764 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16765 *) ac_try_echo=$ac_try;;
16766 esac
16767 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16768 $as_echo "$ac_try_echo") >&5
16769 (eval "$ac_compile") 2>conftest.er1
16770 ac_status=$?
16771 grep -v '^ *+' conftest.er1 >conftest.err
16772 rm -f conftest.er1
16773 cat conftest.err >&5
16774 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16775 (exit $ac_status); } && {
16776 test -z "$ac_c_werror_flag" ||
16777 test ! -s conftest.err
16778 } && test -s conftest.$ac_objext; then
16779 ac_cv_sys_largefile_CC=' -n32'; break
16780 else
16781 $as_echo "$as_me: failed program was:" >&5
16782 sed 's/^/| /' conftest.$ac_ext >&5
16783
16784
16785 fi
16786
16787 rm -f core conftest.err conftest.$ac_objext
16788 break
16789 done
16790 CC=$ac_save_CC
16791 rm -f conftest.$ac_ext
16792 fi
16793 fi
16794 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
16795 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
16796 if test "$ac_cv_sys_largefile_CC" != no; then
16797 CC=$CC$ac_cv_sys_largefile_CC
16798 fi
16799
16800 { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
16801 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
16802 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
16803 $as_echo_n "(cached) " >&6
16804 else
16805 while :; do
16806 cat >conftest.$ac_ext <<_ACEOF
16807 /* confdefs.h. */
16808 _ACEOF
16809 cat confdefs.h >>conftest.$ac_ext
16810 cat >>conftest.$ac_ext <<_ACEOF
16811 /* end confdefs.h. */
16812 #include <sys/types.h>
16813 /* Check that off_t can represent 2**63 - 1 correctly.
16814 We can't simply define LARGE_OFF_T to be 9223372036854775807,
16815 since some C++ compilers masquerading as C compilers
16816 incorrectly reject 9223372036854775807. */
16817 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
16818 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
16819 && LARGE_OFF_T % 2147483647 == 1)
16820 ? 1 : -1];
16821 int
16822 main ()
16823 {
16824
16825 ;
16826 return 0;
16827 }
16828 _ACEOF
16829 rm -f conftest.$ac_objext
16830 if { (ac_try="$ac_compile"
16831 case "(($ac_try" in
16832 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16833 *) ac_try_echo=$ac_try;;
16834 esac
16835 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16836 $as_echo "$ac_try_echo") >&5
16837 (eval "$ac_compile") 2>conftest.er1
16838 ac_status=$?
16839 grep -v '^ *+' conftest.er1 >conftest.err
16840 rm -f conftest.er1
16841 cat conftest.err >&5
16842 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16843 (exit $ac_status); } && {
16844 test -z "$ac_c_werror_flag" ||
16845 test ! -s conftest.err
16846 } && test -s conftest.$ac_objext; then
16847 ac_cv_sys_file_offset_bits=no; break
16848 else
16849 $as_echo "$as_me: failed program was:" >&5
16850 sed 's/^/| /' conftest.$ac_ext >&5
16851
16852
16853 fi
16854
16855 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16856 cat >conftest.$ac_ext <<_ACEOF
16857 /* confdefs.h. */
16858 _ACEOF
16859 cat confdefs.h >>conftest.$ac_ext
16860 cat >>conftest.$ac_ext <<_ACEOF
16861 /* end confdefs.h. */
16862 #define _FILE_OFFSET_BITS 64
16863 #include <sys/types.h>
16864 /* Check that off_t can represent 2**63 - 1 correctly.
16865 We can't simply define LARGE_OFF_T to be 9223372036854775807,
16866 since some C++ compilers masquerading as C compilers
16867 incorrectly reject 9223372036854775807. */
16868 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
16869 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
16870 && LARGE_OFF_T % 2147483647 == 1)
16871 ? 1 : -1];
16872 int
16873 main ()
16874 {
16875
16876 ;
16877 return 0;
16878 }
16879 _ACEOF
16880 rm -f conftest.$ac_objext
16881 if { (ac_try="$ac_compile"
16882 case "(($ac_try" in
16883 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16884 *) ac_try_echo=$ac_try;;
16885 esac
16886 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16887 $as_echo "$ac_try_echo") >&5
16888 (eval "$ac_compile") 2>conftest.er1
16889 ac_status=$?
16890 grep -v '^ *+' conftest.er1 >conftest.err
16891 rm -f conftest.er1
16892 cat conftest.err >&5
16893 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16894 (exit $ac_status); } && {
16895 test -z "$ac_c_werror_flag" ||
16896 test ! -s conftest.err
16897 } && test -s conftest.$ac_objext; then
16898 ac_cv_sys_file_offset_bits=64; break
16899 else
16900 $as_echo "$as_me: failed program was:" >&5
16901 sed 's/^/| /' conftest.$ac_ext >&5
16902
16903
16904 fi
16905
16906 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16907 ac_cv_sys_file_offset_bits=unknown
16908 break
16909 done
16910 fi
16911 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
16912 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
16913 case $ac_cv_sys_file_offset_bits in #(
16914 no | unknown) ;;
16915 *)
16916 cat >>confdefs.h <<_ACEOF
16917 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
16918 _ACEOF
16919 ;;
16920 esac
16921 rm -rf conftest*
16922 if test $ac_cv_sys_file_offset_bits = unknown; then
16923 { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
16924 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
16925 if test "${ac_cv_sys_large_files+set}" = set; then
16926 $as_echo_n "(cached) " >&6
16927 else
16928 while :; do
16929 cat >conftest.$ac_ext <<_ACEOF
16930 /* confdefs.h. */
16931 _ACEOF
16932 cat confdefs.h >>conftest.$ac_ext
16933 cat >>conftest.$ac_ext <<_ACEOF
16934 /* end confdefs.h. */
16935 #include <sys/types.h>
16936 /* Check that off_t can represent 2**63 - 1 correctly.
16937 We can't simply define LARGE_OFF_T to be 9223372036854775807,
16938 since some C++ compilers masquerading as C compilers
16939 incorrectly reject 9223372036854775807. */
16940 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
16941 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
16942 && LARGE_OFF_T % 2147483647 == 1)
16943 ? 1 : -1];
16944 int
16945 main ()
16946 {
16947
16948 ;
16949 return 0;
16950 }
16951 _ACEOF
16952 rm -f conftest.$ac_objext
16953 if { (ac_try="$ac_compile"
16954 case "(($ac_try" in
16955 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16956 *) ac_try_echo=$ac_try;;
16957 esac
16958 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
16959 $as_echo "$ac_try_echo") >&5
16960 (eval "$ac_compile") 2>conftest.er1
16961 ac_status=$?
16962 grep -v '^ *+' conftest.er1 >conftest.err
16963 rm -f conftest.er1
16964 cat conftest.err >&5
16965 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
16966 (exit $ac_status); } && {
16967 test -z "$ac_c_werror_flag" ||
16968 test ! -s conftest.err
16969 } && test -s conftest.$ac_objext; then
16970 ac_cv_sys_large_files=no; break
16971 else
16972 $as_echo "$as_me: failed program was:" >&5
16973 sed 's/^/| /' conftest.$ac_ext >&5
16974
16975
16976 fi
16977
16978 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16979 cat >conftest.$ac_ext <<_ACEOF
16980 /* confdefs.h. */
16981 _ACEOF
16982 cat confdefs.h >>conftest.$ac_ext
16983 cat >>conftest.$ac_ext <<_ACEOF
16984 /* end confdefs.h. */
16985 #define _LARGE_FILES 1
16986 #include <sys/types.h>
16987 /* Check that off_t can represent 2**63 - 1 correctly.
16988 We can't simply define LARGE_OFF_T to be 9223372036854775807,
16989 since some C++ compilers masquerading as C compilers
16990 incorrectly reject 9223372036854775807. */
16991 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
16992 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
16993 && LARGE_OFF_T % 2147483647 == 1)
16994 ? 1 : -1];
16995 int
16996 main ()
16997 {
16998
16999 ;
17000 return 0;
17001 }
17002 _ACEOF
17003 rm -f conftest.$ac_objext
17004 if { (ac_try="$ac_compile"
17005 case "(($ac_try" in
17006 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17007 *) ac_try_echo=$ac_try;;
17008 esac
17009 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17010 $as_echo "$ac_try_echo") >&5
17011 (eval "$ac_compile") 2>conftest.er1
17012 ac_status=$?
17013 grep -v '^ *+' conftest.er1 >conftest.err
17014 rm -f conftest.er1
17015 cat conftest.err >&5
17016 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17017 (exit $ac_status); } && {
17018 test -z "$ac_c_werror_flag" ||
17019 test ! -s conftest.err
17020 } && test -s conftest.$ac_objext; then
17021 ac_cv_sys_large_files=1; break
17022 else
17023 $as_echo "$as_me: failed program was:" >&5
17024 sed 's/^/| /' conftest.$ac_ext >&5
17025
17026
17027 fi
17028
17029 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17030 ac_cv_sys_large_files=unknown
17031 break
17032 done
17033 fi
17034 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
17035 $as_echo "$ac_cv_sys_large_files" >&6; }
17036 case $ac_cv_sys_large_files in #(
17037 no | unknown) ;;
17038 *)
17039 cat >>confdefs.h <<_ACEOF
17040 #define _LARGE_FILES $ac_cv_sys_large_files
17041 _ACEOF
17042 ;;
17043 esac
17044 rm -rf conftest*
17045 fi
17046 fi
17047
17048
17049
17050
17051 { $as_echo "$as_me:$LINENO: checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC" >&5
17052 $as_echo_n "checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC... " >&6; }
17053 cache=_D_LARGEFILE_SOURCE_1
17054 if { as_var=cv_prog_cc_flag_needed_$cache; eval "test \"\${$as_var+set}\" = set"; }; then
17055 $as_echo_n "(cached) " >&6
17056 else
17057
17058 echo '
17059 #include <stdio.h>
17060 int test() {
17061 int a = fseeko(stdin, 0, 0);
17062 return a;
17063 }
17064 ' > conftest.c
17065 echo 'void f(){}' >>conftest.c
17066 if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
17067 eval "cv_prog_cc_flag_needed_$cache=no"
17068 else
17069
17070 if test -z "`$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`"; then
17071 eval "cv_prog_cc_flag_needed_$cache=yes"
17072 else
17073 eval "cv_prog_cc_flag_needed_$cache=fail"
17074 #echo 'Test with flag fails too!'
17075 #cat conftest.c
17076 #echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1"
17077 #echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`
17078 #exit 1
17079 fi
17080
17081 fi
17082 rm -f conftest conftest.c conftest.o
17083
17084 fi
17085
17086 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
17087 { $as_echo "$as_me:$LINENO: result: yes" >&5
17088 $as_echo "yes" >&6; }
17089 :
17090 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE=1"
17091 else
17092 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
17093 { $as_echo "$as_me:$LINENO: result: no" >&5
17094 $as_echo "no" >&6; }
17095 #echo 'Test with flag is no!'
17096 #cat conftest.c
17097 #echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1"
17098 #echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`
17099 #exit 1
17100 :
17101
17102 else
17103 { $as_echo "$as_me:$LINENO: result: failed" >&5
17104 $as_echo "failed" >&6; }
17105 :
17106
17107 fi
17108 fi
17109
17110
17111
17112 { $as_echo "$as_me:$LINENO: checking if nonblocking sockets work" >&5
17113 $as_echo_n "checking if nonblocking sockets work... " >&6; }
17114 if echo $target | grep mingw32 >/dev/null; then
17115 { $as_echo "$as_me:$LINENO: result: no (windows)" >&5
17116 $as_echo "no (windows)" >&6; }
17117
17118 cat >>confdefs.h <<\_ACEOF
17119 #define NONBLOCKING_IS_BROKEN 1
17120 _ACEOF
17121
17122 else
17123 if test "$cross_compiling" = yes; then
17124
17125 { $as_echo "$as_me:$LINENO: result: crosscompile(yes)" >&5
17126 $as_echo "crosscompile(yes)" >&6; }
17127
17128 else
17129 cat >conftest.$ac_ext <<_ACEOF
17130 /* confdefs.h. */
17131 _ACEOF
17132 cat confdefs.h >>conftest.$ac_ext
17133 cat >>conftest.$ac_ext <<_ACEOF
17134 /* end confdefs.h. */
17135
17136 #include <stdio.h>
17137 #include <string.h>
17138 #include <stdlib.h>
17139 #include <fcntl.h>
17140 #include <errno.h>
17141 #ifdef HAVE_SYS_TYPES_H
17142 #include <sys/types.h>
17143 #endif
17144 #ifdef HAVE_SYS_SOCKET_H
17145 #include <sys/socket.h>
17146 #endif
17147 #ifdef HAVE_NETINET_IN_H
17148 #include <netinet/in.h>
17149 #endif
17150 #ifdef HAVE_ARPA_INET_H
17151 #include <arpa/inet.h>
17152 #endif
17153 #ifdef HAVE_UNISTD_H
17154 #include <unistd.h>
17155 #endif
17156 #ifdef HAVE_TIME_H
17157 #include <time.h>
17158 #endif
17159
17160 int
17161 main ()
17162 {
17163
17164 int port;
17165 int sfd, cfd;
17166 int num = 10;
17167 int i, p;
17168 struct sockaddr_in a;
17169 /* test if select and nonblocking reads work well together */
17170 /* open port.
17171 fork child to send 10 messages.
17172 select to read.
17173 then try to nonblocking read the 10 messages
17174 then, nonblocking read must give EAGAIN
17175 */
17176
17177 port = 12345 + (time(0)%32);
17178 sfd = socket(PF_INET, SOCK_DGRAM, 0);
17179 if(sfd == -1) {
17180 perror("socket");
17181 return 1;
17182 }
17183 memset(&a, 0, sizeof(a));
17184 a.sin_family = AF_INET;
17185 a.sin_port = htons(port);
17186 a.sin_addr.s_addr = inet_addr("127.0.0.1");
17187 if(bind(sfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
17188 perror("bind");
17189 return 1;
17190 }
17191 if(fcntl(sfd, F_SETFL, O_NONBLOCK) == -1) {
17192 perror("fcntl");
17193 return 1;
17194 }
17195
17196 cfd = socket(PF_INET, SOCK_DGRAM, 0);
17197 if(cfd == -1) {
17198 perror("client socket");
17199 return 1;
17200 }
17201 a.sin_port = 0;
17202 if(bind(cfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
17203 perror("client bind");
17204 return 1;
17205 }
17206 a.sin_port = htons(port);
17207
17208 /* no handler, causes exit in 10 seconds */
17209 alarm(10);
17210
17211 /* send and receive on the socket */
17212 if((p=fork()) == 0) {
17213 for(i=0; i<num; i++) {
17214 if(sendto(cfd, &i, sizeof(i), 0,
17215 (struct sockaddr*)&a, sizeof(a)) < 0) {
17216 perror("sendto");
17217 return 1;
17218 }
17219 }
17220 } else {
17221 /* parent */
17222 fd_set rset;
17223 int x;
17224 if(p == -1) {
17225 perror("fork");
17226 return 1;
17227 }
17228 FD_ZERO(&rset);
17229 FD_SET(sfd, &rset);
17230 if(select(sfd+1, &rset, NULL, NULL, NULL) < 1) {
17231 perror("select");
17232 return 1;
17233 }
17234 i = 0;
17235 while(i < num) {
17236 if(recv(sfd, &x, sizeof(x), 0) != sizeof(x)) {
17237 if(errno == EAGAIN)
17238 continue;
17239 perror("recv");
17240 return 1;
17241 }
17242 i++;
17243 }
17244 /* now we want to get EAGAIN: nonblocking goodness */
17245 errno = 0;
17246 recv(sfd, &x, sizeof(x), 0);
17247 if(errno != EAGAIN) {
17248 perror("trying to recv again");
17249 return 1;
17250 }
17251 /* EAGAIN encountered */
17252 }
17253
17254 close(sfd);
17255 close(cfd);
17256
17257 ;
17258 return 0;
17259 }
17260 _ACEOF
17261 rm -f conftest$ac_exeext
17262 if { (ac_try="$ac_link"
17263 case "(($ac_try" in
17264 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17265 *) ac_try_echo=$ac_try;;
17266 esac
17267 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17268 $as_echo "$ac_try_echo") >&5
17269 (eval "$ac_link") 2>&5
17270 ac_status=$?
17271 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17272 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17273 { (case "(($ac_try" in
17274 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17275 *) ac_try_echo=$ac_try;;
17276 esac
17277 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17278 $as_echo "$ac_try_echo") >&5
17279 (eval "$ac_try") 2>&5
17280 ac_status=$?
17281 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17282 (exit $ac_status); }; }; then
17283
17284 { $as_echo "$as_me:$LINENO: result: yes" >&5
17285 $as_echo "yes" >&6; }
17286
17287 else
17288 $as_echo "$as_me: program exited with status $ac_status" >&5
17289 $as_echo "$as_me: failed program was:" >&5
17290 sed 's/^/| /' conftest.$ac_ext >&5
17291
17292 ( exit $ac_status )
17293
17294 { $as_echo "$as_me:$LINENO: result: no" >&5
17295 $as_echo "no" >&6; }
17296
17297 cat >>confdefs.h <<\_ACEOF
17298 #define NONBLOCKING_IS_BROKEN 1
17299 _ACEOF
17300
17301
17302 fi
17303 rm -rf conftest.dSYM
17304 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17305 fi
17306
17307
17308 fi
17309
17310
17311 { $as_echo "$as_me:$LINENO: checking whether mkdir has one arg" >&5
17312 $as_echo_n "checking whether mkdir has one arg... " >&6; }
17313 cat >conftest.$ac_ext <<_ACEOF
17314 /* confdefs.h. */
17315 _ACEOF
17316 cat confdefs.h >>conftest.$ac_ext
17317 cat >>conftest.$ac_ext <<_ACEOF
17318 /* end confdefs.h. */
17319
17320 #include <stdio.h>
17321 #include <unistd.h>
17322 #ifdef HAVE_WINSOCK2_H
17323 #include <winsock2.h>
17324 #endif
17325 #ifdef HAVE_SYS_STAT_H
17326 #include <sys/stat.h>
17327 #endif
17328
17329 int
17330 main ()
17331 {
17332
17333 (void)mkdir("directory");
17334
17335 ;
17336 return 0;
17337 }
17338 _ACEOF
17339 rm -f conftest.$ac_objext
17340 if { (ac_try="$ac_compile"
17341 case "(($ac_try" in
17342 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17343 *) ac_try_echo=$ac_try;;
17344 esac
17345 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
17346 $as_echo "$ac_try_echo") >&5
17347 (eval "$ac_compile") 2>conftest.er1
17348 ac_status=$?
17349 grep -v '^ *+' conftest.er1 >conftest.err
17350 rm -f conftest.er1
17351 cat conftest.err >&5
17352 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
17353 (exit $ac_status); } && {
17354 test -z "$ac_c_werror_flag" ||
17355 test ! -s conftest.err
17356 } && test -s conftest.$ac_objext; then
17357 { $as_echo "$as_me:$LINENO: result: yes" >&5
17358 $as_echo "yes" >&6; }
17359
17360 cat >>confdefs.h <<\_ACEOF
17361 #define MKDIR_HAS_ONE_ARG 1
17362 _ACEOF
17363
17364
17365 else
17366 $as_echo "$as_me: failed program was:" >&5
17367 sed 's/^/| /' conftest.$ac_ext >&5
17368
17369 { $as_echo "$as_me:$LINENO: result: no" >&5
17370 $as_echo "no" >&6; }
17371
17372 fi
17373
17374 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17375
17376
1557517377 # check for thread library.
1557617378 # check this first, so that the pthread lib does not get linked in via
1557717379 # libssl or libpython, and thus distorts the tests, and we end up using
1655718359
1655818360 # Check for Python
1655918361 ub_have_python=no
16560
18362 ac_save_LIBS="$LIBS"
1656118363 #
1656218364 # Allow the use of a (user set) custom python version
1656318365 #
1821420016 if test "x$ac_cv_func_EVP_PKEY_set_type_str" = x""yes; then
1821520017 :
1821620018 else
18217 { { $as_echo "$as_me:$LINENO: error: OpenSSL >= 1.0.0 is needed for GOST support" >&5
18218 $as_echo "$as_me: error: OpenSSL >= 1.0.0 is needed for GOST support" >&2;}
20019 { { $as_echo "$as_me:$LINENO: error: OpenSSL >= 1.0.0 is needed for GOST support, upgrade openssl or rerun with --disable-gost" >&5
20020 $as_echo "$as_me: error: OpenSSL >= 1.0.0 is needed for GOST support, upgrade openssl or rerun with --disable-gost" >&2;}
1821920021 { (exit 1); exit 1; }; }
1822020022 fi
1822120023
1822820030 no|*)
1822920031 ;;
1823020032 esac
18231
18232 # check to see if libraries are needed for these functions.
18233 { $as_echo "$as_me:$LINENO: checking for library containing inet_pton" >&5
18234 $as_echo_n "checking for library containing inet_pton... " >&6; }
18235 if test "${ac_cv_search_inet_pton+set}" = set; then
18236 $as_echo_n "(cached) " >&6
18237 else
18238 ac_func_search_save_LIBS=$LIBS
18239 cat >conftest.$ac_ext <<_ACEOF
18240 /* confdefs.h. */
18241 _ACEOF
18242 cat confdefs.h >>conftest.$ac_ext
18243 cat >>conftest.$ac_ext <<_ACEOF
18244 /* end confdefs.h. */
18245
18246 /* Override any GCC internal prototype to avoid an error.
18247 Use char because int might match the return type of a GCC
18248 builtin and then its argument prototype would still apply. */
18249 #ifdef __cplusplus
18250 extern "C"
18251 #endif
18252 char inet_pton ();
18253 int
18254 main ()
18255 {
18256 return inet_pton ();
18257 ;
18258 return 0;
18259 }
18260 _ACEOF
18261 for ac_lib in '' nsl; do
18262 if test -z "$ac_lib"; then
18263 ac_res="none required"
18264 else
18265 ac_res=-l$ac_lib
18266 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
18267 fi
18268 rm -f conftest.$ac_objext conftest$ac_exeext
18269 if { (ac_try="$ac_link"
18270 case "(($ac_try" in
18271 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18272 *) ac_try_echo=$ac_try;;
18273 esac
18274 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18275 $as_echo "$ac_try_echo") >&5
18276 (eval "$ac_link") 2>conftest.er1
18277 ac_status=$?
18278 grep -v '^ *+' conftest.er1 >conftest.err
18279 rm -f conftest.er1
18280 cat conftest.err >&5
18281 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18282 (exit $ac_status); } && {
18283 test -z "$ac_c_werror_flag" ||
18284 test ! -s conftest.err
18285 } && test -s conftest$ac_exeext && {
18286 test "$cross_compiling" = yes ||
18287 $as_test_x conftest$ac_exeext
18288 }; then
18289 ac_cv_search_inet_pton=$ac_res
18290 else
18291 $as_echo "$as_me: failed program was:" >&5
18292 sed 's/^/| /' conftest.$ac_ext >&5
18293
18294
18295 fi
18296
18297 rm -rf conftest.dSYM
18298 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18299 conftest$ac_exeext
18300 if test "${ac_cv_search_inet_pton+set}" = set; then
18301 break
18302 fi
18303 done
18304 if test "${ac_cv_search_inet_pton+set}" = set; then
18305 :
18306 else
18307 ac_cv_search_inet_pton=no
18308 fi
18309 rm conftest.$ac_ext
18310 LIBS=$ac_func_search_save_LIBS
18311 fi
18312 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_inet_pton" >&5
18313 $as_echo "$ac_cv_search_inet_pton" >&6; }
18314 ac_res=$ac_cv_search_inet_pton
18315 if test "$ac_res" != no; then
18316 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
18317
18318 fi
18319
18320 { $as_echo "$as_me:$LINENO: checking for library containing socket" >&5
18321 $as_echo_n "checking for library containing socket... " >&6; }
18322 if test "${ac_cv_search_socket+set}" = set; then
18323 $as_echo_n "(cached) " >&6
18324 else
18325 ac_func_search_save_LIBS=$LIBS
18326 cat >conftest.$ac_ext <<_ACEOF
18327 /* confdefs.h. */
18328 _ACEOF
18329 cat confdefs.h >>conftest.$ac_ext
18330 cat >>conftest.$ac_ext <<_ACEOF
18331 /* end confdefs.h. */
18332
18333 /* Override any GCC internal prototype to avoid an error.
18334 Use char because int might match the return type of a GCC
18335 builtin and then its argument prototype would still apply. */
18336 #ifdef __cplusplus
18337 extern "C"
18338 #endif
18339 char socket ();
18340 int
18341 main ()
18342 {
18343 return socket ();
18344 ;
18345 return 0;
18346 }
18347 _ACEOF
18348 for ac_lib in '' socket; do
18349 if test -z "$ac_lib"; then
18350 ac_res="none required"
18351 else
18352 ac_res=-l$ac_lib
18353 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
18354 fi
18355 rm -f conftest.$ac_objext conftest$ac_exeext
18356 if { (ac_try="$ac_link"
18357 case "(($ac_try" in
18358 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18359 *) ac_try_echo=$ac_try;;
18360 esac
18361 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
18362 $as_echo "$ac_try_echo") >&5
18363 (eval "$ac_link") 2>conftest.er1
18364 ac_status=$?
18365 grep -v '^ *+' conftest.er1 >conftest.err
18366 rm -f conftest.er1
18367 cat conftest.err >&5
18368 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
18369 (exit $ac_status); } && {
18370 test -z "$ac_c_werror_flag" ||
18371 test ! -s conftest.err
18372 } && test -s conftest$ac_exeext && {
18373 test "$cross_compiling" = yes ||
18374 $as_test_x conftest$ac_exeext
18375 }; then
18376 ac_cv_search_socket=$ac_res
18377 else
18378 $as_echo "$as_me: failed program was:" >&5
18379 sed 's/^/| /' conftest.$ac_ext >&5
18380
18381
18382 fi
18383
18384 rm -rf conftest.dSYM
18385 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18386 conftest$ac_exeext
18387 if test "${ac_cv_search_socket+set}" = set; then
18388 break
18389 fi
18390 done
18391 if test "${ac_cv_search_socket+set}" = set; then
18392 :
18393 else
18394 ac_cv_search_socket=no
18395 fi
18396 rm conftest.$ac_ext
18397 LIBS=$ac_func_search_save_LIBS
18398 fi
18399 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5
18400 $as_echo "$ac_cv_search_socket" >&6; }
18401 ac_res=$ac_cv_search_socket
18402 if test "$ac_res" != no; then
18403 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
18404
18405 fi
18406
18407
18408
1840920033
1841020034 # check for libevent
1841120035
1956021184 fi
1956121185
1956221186
19563 for ac_header in unistd.h
21187 { $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5
21188 $as_echo_n "checking for getaddrinfo... " >&6; }
21189 ac_cv_func_getaddrinfo=no
21190 cat >conftest.$ac_ext <<_ACEOF
21191
21192 #ifdef __cplusplus
21193 extern "C"
21194 {
21195 #endif
21196 char* getaddrinfo();
21197 char* (*f) () = getaddrinfo;
21198 #ifdef __cplusplus
21199 }
21200 #endif
21201 int main() {
21202 ;
21203 return 0;
21204 }
21205
21206 _ACEOF
21207 rm -f conftest.$ac_objext conftest$ac_exeext
21208 if { (ac_try="$ac_link"
21209 case "(($ac_try" in
21210 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21211 *) ac_try_echo=$ac_try;;
21212 esac
21213 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21214 $as_echo "$ac_try_echo") >&5
21215 (eval "$ac_link") 2>conftest.er1
21216 ac_status=$?
21217 grep -v '^ *+' conftest.er1 >conftest.err
21218 rm -f conftest.er1
21219 cat conftest.err >&5
21220 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21221 (exit $ac_status); } && {
21222 test -z "$ac_c_werror_flag" ||
21223 test ! -s conftest.err
21224 } && test -s conftest$ac_exeext && {
21225 test "$cross_compiling" = yes ||
21226 $as_test_x conftest$ac_exeext
21227 }; then
21228 ac_cv_func_getaddrinfo="yes"
21229 else
21230 $as_echo "$as_me: failed program was:" >&5
21231 sed 's/^/| /' conftest.$ac_ext >&5
21232
21233 ORIGLIBS="$LIBS"
21234 LIBS="$LIBS -lws2_32"
21235 cat >conftest.$ac_ext <<_ACEOF
21236 /* confdefs.h. */
21237 _ACEOF
21238 cat confdefs.h >>conftest.$ac_ext
21239 cat >>conftest.$ac_ext <<_ACEOF
21240 /* end confdefs.h. */
21241
21242 #ifdef HAVE_WS2TCPIP_H
21243 #include <ws2tcpip.h>
21244 #endif
21245
21246 int
21247 main ()
21248 {
21249
21250 (void)getaddrinfo(NULL, NULL, NULL, NULL);
21251
21252
21253 ;
21254 return 0;
21255 }
21256 _ACEOF
21257 rm -f conftest.$ac_objext conftest$ac_exeext
21258 if { (ac_try="$ac_link"
21259 case "(($ac_try" in
21260 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21261 *) ac_try_echo=$ac_try;;
21262 esac
21263 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21264 $as_echo "$ac_try_echo") >&5
21265 (eval "$ac_link") 2>conftest.er1
21266 ac_status=$?
21267 grep -v '^ *+' conftest.er1 >conftest.err
21268 rm -f conftest.er1
21269 cat conftest.err >&5
21270 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21271 (exit $ac_status); } && {
21272 test -z "$ac_c_werror_flag" ||
21273 test ! -s conftest.err
21274 } && test -s conftest$ac_exeext && {
21275 test "$cross_compiling" = yes ||
21276 $as_test_x conftest$ac_exeext
21277 }; then
21278
21279 ac_cv_func_getaddrinfo="yes"
21280
21281 cat >>confdefs.h <<\_ACEOF
21282 #define USE_WINSOCK 1
21283 _ACEOF
21284
21285 USE_WINSOCK="1"
21286
21287 else
21288 $as_echo "$as_me: failed program was:" >&5
21289 sed 's/^/| /' conftest.$ac_ext >&5
21290
21291
21292 ac_cv_func_getaddrinfo="no"
21293 LIBS="$ORIGLIBS"
21294
21295 fi
21296
21297 rm -rf conftest.dSYM
21298 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21299 conftest$ac_exeext conftest.$ac_ext
21300
21301 fi
21302
21303 rm -rf conftest.dSYM
21304 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21305 conftest$ac_exeext conftest.$ac_ext
21306
21307 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
21308 $as_echo "$ac_cv_func_getaddrinfo" >&6; }
21309 if test $ac_cv_func_getaddrinfo = yes; then
21310
21311 cat >>confdefs.h <<\_ACEOF
21312 #define HAVE_GETADDRINFO 1
21313 _ACEOF
21314
21315 fi
21316
21317 if test "$USE_WINSOCK" = 1; then
21318
21319 cat >>confdefs.h <<\_ACEOF
21320 #define UB_ON_WINDOWS 1
21321 _ACEOF
21322
21323 UB_ON_WINDOWS=yes
21324
21325
21326 for ac_header in iphlpapi.h
1956421327 do
1956521328 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
19566 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19567 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
21329 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
1956821330 $as_echo_n "checking for $ac_header... " >&6; }
1956921331 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
1957021332 $as_echo_n "(cached) " >&6
19571 fi
19572 ac_res=`eval 'as_val=${'$as_ac_Header'}
19573 $as_echo "$as_val"'`
19574 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19575 $as_echo "$ac_res" >&6; }
19576 else
19577 # Is the header compilable?
19578 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
19579 $as_echo_n "checking $ac_header usability... " >&6; }
19580 cat >conftest.$ac_ext <<_ACEOF
21333 else
21334 cat >conftest.$ac_ext <<_ACEOF
1958121335 /* confdefs.h. */
1958221336 _ACEOF
1958321337 cat confdefs.h >>conftest.$ac_ext
1958421338 cat >>conftest.$ac_ext <<_ACEOF
1958521339 /* end confdefs.h. */
1958621340 $ac_includes_default
21341 #include <windows.h>
21342
21343
1958721344 #include <$ac_header>
1958821345 _ACEOF
1958921346 rm -f conftest.$ac_objext
1960421361 test -z "$ac_c_werror_flag" ||
1960521362 test ! -s conftest.err
1960621363 } && test -s conftest.$ac_objext; then
19607 ac_header_compiler=yes
21364 eval "$as_ac_Header=yes"
1960821365 else
1960921366 $as_echo "$as_me: failed program was:" >&5
1961021367 sed 's/^/| /' conftest.$ac_ext >&5
1961121368
19612 ac_header_compiler=no
21369 eval "$as_ac_Header=no"
1961321370 fi
1961421371
1961521372 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19616 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
19617 $as_echo "$ac_header_compiler" >&6; }
19618
19619 # Is the header present?
19620 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
19621 $as_echo_n "checking $ac_header presence... " >&6; }
19622 cat >conftest.$ac_ext <<_ACEOF
19623 /* confdefs.h. */
19624 _ACEOF
19625 cat confdefs.h >>conftest.$ac_ext
19626 cat >>conftest.$ac_ext <<_ACEOF
19627 /* end confdefs.h. */
19628 #include <$ac_header>
19629 _ACEOF
19630 if { (ac_try="$ac_cpp conftest.$ac_ext"
19631 case "(($ac_try" in
19632 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19633 *) ac_try_echo=$ac_try;;
19634 esac
19635 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19636 $as_echo "$ac_try_echo") >&5
19637 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
19638 ac_status=$?
19639 grep -v '^ *+' conftest.er1 >conftest.err
19640 rm -f conftest.er1
19641 cat conftest.err >&5
19642 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19643 (exit $ac_status); } >/dev/null && {
19644 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
19645 test ! -s conftest.err
19646 }; then
19647 ac_header_preproc=yes
19648 else
19649 $as_echo "$as_me: failed program was:" >&5
19650 sed 's/^/| /' conftest.$ac_ext >&5
19651
19652 ac_header_preproc=no
19653 fi
19654
19655 rm -f conftest.err conftest.$ac_ext
19656 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
19657 $as_echo "$ac_header_preproc" >&6; }
19658
19659 # So? What about this header?
19660 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
19661 yes:no: )
19662 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
19663 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
19664 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
19665 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
19666 ac_header_preproc=yes
19667 ;;
19668 no:yes:* )
19669 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
19670 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
19671 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
19672 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
19673 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
19674 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
19675 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
19676 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
19677 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
19678 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
19679 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
19680 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
19681 ( cat <<\_ASBOX
19682 ## ---------------------------------------- ##
19683 ## Report this to unbound-bugs@nlnetlabs.nl ##
19684 ## ---------------------------------------- ##
19685 _ASBOX
19686 ) | sed "s/^/$as_me: WARNING: /" >&2
19687 ;;
19688 esac
19689 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
19690 $as_echo_n "checking for $ac_header... " >&6; }
19691 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19692 $as_echo_n "(cached) " >&6
19693 else
19694 eval "$as_ac_Header=\$ac_header_preproc"
1969521373 fi
1969621374 ac_res=`eval 'as_val=${'$as_ac_Header'}
1969721375 $as_echo "$as_val"'`
1969821376 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
1969921377 $as_echo "$ac_res" >&6; }
19700
19701 fi
1970221378 as_val=`eval 'as_val=${'$as_ac_Header'}
1970321379 $as_echo "$as_val"'`
1970421380 if test "x$as_val" = x""yes; then
1971021386
1971121387 done
1971221388
19713 { $as_echo "$as_me:$LINENO: checking for working chown" >&5
19714 $as_echo_n "checking for working chown... " >&6; }
19715 if test "${ac_cv_func_chown_works+set}" = set; then
21389 if test -n "$ac_tool_prefix"; then
21390 # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
21391 set dummy ${ac_tool_prefix}windres; ac_word=$2
21392 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
21393 $as_echo_n "checking for $ac_word... " >&6; }
21394 if test "${ac_cv_prog_WINDRES+set}" = set; then
1971621395 $as_echo_n "(cached) " >&6
1971721396 else
19718 if test "$cross_compiling" = yes; then
19719 ac_cv_func_chown_works=no
19720 else
19721 cat >conftest.$ac_ext <<_ACEOF
21397 if test -n "$WINDRES"; then
21398 ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
21399 else
21400 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
21401 for as_dir in $PATH
21402 do
21403 IFS=$as_save_IFS
21404 test -z "$as_dir" && as_dir=.
21405 for ac_exec_ext in '' $ac_executable_extensions; do
21406 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
21407 ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
21408 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
21409 break 2
21410 fi
21411 done
21412 done
21413 IFS=$as_save_IFS
21414
21415 fi
21416 fi
21417 WINDRES=$ac_cv_prog_WINDRES
21418 if test -n "$WINDRES"; then
21419 { $as_echo "$as_me:$LINENO: result: $WINDRES" >&5
21420 $as_echo "$WINDRES" >&6; }
21421 else
21422 { $as_echo "$as_me:$LINENO: result: no" >&5
21423 $as_echo "no" >&6; }
21424 fi
21425
21426
21427 fi
21428 if test -z "$ac_cv_prog_WINDRES"; then
21429 ac_ct_WINDRES=$WINDRES
21430 # Extract the first word of "windres", so it can be a program name with args.
21431 set dummy windres; ac_word=$2
21432 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
21433 $as_echo_n "checking for $ac_word... " >&6; }
21434 if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
21435 $as_echo_n "(cached) " >&6
21436 else
21437 if test -n "$ac_ct_WINDRES"; then
21438 ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
21439 else
21440 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
21441 for as_dir in $PATH
21442 do
21443 IFS=$as_save_IFS
21444 test -z "$as_dir" && as_dir=.
21445 for ac_exec_ext in '' $ac_executable_extensions; do
21446 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
21447 ac_cv_prog_ac_ct_WINDRES="windres"
21448 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
21449 break 2
21450 fi
21451 done
21452 done
21453 IFS=$as_save_IFS
21454
21455 fi
21456 fi
21457 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
21458 if test -n "$ac_ct_WINDRES"; then
21459 { $as_echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
21460 $as_echo "$ac_ct_WINDRES" >&6; }
21461 else
21462 { $as_echo "$as_me:$LINENO: result: no" >&5
21463 $as_echo "no" >&6; }
21464 fi
21465
21466 if test "x$ac_ct_WINDRES" = x; then
21467 WINDRES=""
21468 else
21469 case $cross_compiling:$ac_tool_warned in
21470 yes:)
21471 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
21472 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
21473 ac_tool_warned=yes ;;
21474 esac
21475 WINDRES=$ac_ct_WINDRES
21476 fi
21477 else
21478 WINDRES="$ac_cv_prog_WINDRES"
21479 fi
21480
21481 LIBS="$LIBS -liphlpapi"
21482 fi
21483 if test $ac_cv_func_getaddrinfo = no; then
21484 case " $LIBOBJS " in
21485 *" fake-rfc2553.$ac_objext "* ) ;;
21486 *) LIBOBJS="$LIBOBJS fake-rfc2553.$ac_objext"
21487 ;;
21488 esac
21489
21490 fi
21491 # check after getaddrinfo for its libraries
21492
21493 # check ioctlsocket
21494 { $as_echo "$as_me:$LINENO: checking for ioctlsocket" >&5
21495 $as_echo_n "checking for ioctlsocket... " >&6; }
21496 cat >conftest.$ac_ext <<_ACEOF
1972221497 /* confdefs.h. */
1972321498 _ACEOF
1972421499 cat confdefs.h >>conftest.$ac_ext
1972521500 cat >>conftest.$ac_ext <<_ACEOF
1972621501 /* end confdefs.h. */
19727 $ac_includes_default
19728 #include <fcntl.h>
21502
21503 #ifdef HAVE_WINSOCK2_H
21504 #include <winsock2.h>
21505 #endif
1972921506
1973021507 int
1973121508 main ()
1973221509 {
19733 char *f = "conftest.chown";
19734 struct stat before, after;
19735
19736 if (creat (f, 0600) < 0)
19737 return 1;
19738 if (stat (f, &before) < 0)
19739 return 1;
19740 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
19741 return 1;
19742 if (stat (f, &after) < 0)
19743 return 1;
19744 return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid);
21510
21511 (void)ioctlsocket(0, 0, NULL);
1974521512
1974621513 ;
1974721514 return 0;
1974821515 }
1974921516 _ACEOF
19750 rm -f conftest$ac_exeext
21517 rm -f conftest.$ac_objext conftest$ac_exeext
1975121518 if { (ac_try="$ac_link"
1975221519 case "(($ac_try" in
1975321520 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1975521522 esac
1975621523 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
1975721524 $as_echo "$ac_try_echo") >&5
19758 (eval "$ac_link") 2>&5
19759 ac_status=$?
19760 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19761 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19762 { (case "(($ac_try" in
19763 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19764 *) ac_try_echo=$ac_try;;
19765 esac
19766 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19767 $as_echo "$ac_try_echo") >&5
19768 (eval "$ac_try") 2>&5
19769 ac_status=$?
19770 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19771 (exit $ac_status); }; }; then
19772 ac_cv_func_chown_works=yes
19773 else
19774 $as_echo "$as_me: program exited with status $ac_status" >&5
19775 $as_echo "$as_me: failed program was:" >&5
19776 sed 's/^/| /' conftest.$ac_ext >&5
19777
19778 ( exit $ac_status )
19779 ac_cv_func_chown_works=no
19780 fi
19781 rm -rf conftest.dSYM
19782 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19783 fi
19784
19785
19786 rm -f conftest.chown
19787
19788 fi
19789 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_chown_works" >&5
19790 $as_echo "$ac_cv_func_chown_works" >&6; }
19791 if test $ac_cv_func_chown_works = yes; then
19792
19793 cat >>confdefs.h <<\_ACEOF
19794 #define HAVE_CHOWN 1
19795 _ACEOF
19796
19797 fi
19798
19799
19800 for ac_header in vfork.h
19801 do
19802 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
19803 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19804 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
19805 $as_echo_n "checking for $ac_header... " >&6; }
19806 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19807 $as_echo_n "(cached) " >&6
19808 fi
19809 ac_res=`eval 'as_val=${'$as_ac_Header'}
19810 $as_echo "$as_val"'`
19811 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19812 $as_echo "$ac_res" >&6; }
19813 else
19814 # Is the header compilable?
19815 { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
19816 $as_echo_n "checking $ac_header usability... " >&6; }
19817 cat >conftest.$ac_ext <<_ACEOF
19818 /* confdefs.h. */
19819 _ACEOF
19820 cat confdefs.h >>conftest.$ac_ext
19821 cat >>conftest.$ac_ext <<_ACEOF
19822 /* end confdefs.h. */
19823 $ac_includes_default
19824 #include <$ac_header>
19825 _ACEOF
19826 rm -f conftest.$ac_objext
19827 if { (ac_try="$ac_compile"
19828 case "(($ac_try" in
19829 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19830 *) ac_try_echo=$ac_try;;
19831 esac
19832 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19833 $as_echo "$ac_try_echo") >&5
19834 (eval "$ac_compile") 2>conftest.er1
21525 (eval "$ac_link") 2>conftest.er1
1983521526 ac_status=$?
1983621527 grep -v '^ *+' conftest.er1 >conftest.err
1983721528 rm -f conftest.er1
1984021531 (exit $ac_status); } && {
1984121532 test -z "$ac_c_werror_flag" ||
1984221533 test ! -s conftest.err
19843 } && test -s conftest.$ac_objext; then
19844 ac_header_compiler=yes
21534 } && test -s conftest$ac_exeext && {
21535 test "$cross_compiling" = yes ||
21536 $as_test_x conftest$ac_exeext
21537 }; then
21538
21539 { $as_echo "$as_me:$LINENO: result: yes" >&5
21540 $as_echo "yes" >&6; }
21541
21542 cat >>confdefs.h <<\_ACEOF
21543 #define HAVE_IOCTLSOCKET 1
21544 _ACEOF
21545
21546
1984521547 else
1984621548 $as_echo "$as_me: failed program was:" >&5
1984721549 sed 's/^/| /' conftest.$ac_ext >&5
1984821550
19849 ac_header_compiler=no
19850 fi
19851
19852 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19853 { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
19854 $as_echo "$ac_header_compiler" >&6; }
19855
19856 # Is the header present?
19857 { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
19858 $as_echo_n "checking $ac_header presence... " >&6; }
19859 cat >conftest.$ac_ext <<_ACEOF
19860 /* confdefs.h. */
19861 _ACEOF
19862 cat confdefs.h >>conftest.$ac_ext
19863 cat >>conftest.$ac_ext <<_ACEOF
19864 /* end confdefs.h. */
19865 #include <$ac_header>
19866 _ACEOF
19867 if { (ac_try="$ac_cpp conftest.$ac_ext"
19868 case "(($ac_try" in
19869 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19870 *) ac_try_echo=$ac_try;;
19871 esac
19872 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
19873 $as_echo "$ac_try_echo") >&5
19874 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
19875 ac_status=$?
19876 grep -v '^ *+' conftest.er1 >conftest.err
19877 rm -f conftest.er1
19878 cat conftest.err >&5
19879 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
19880 (exit $ac_status); } >/dev/null && {
19881 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
19882 test ! -s conftest.err
19883 }; then
19884 ac_header_preproc=yes
19885 else
19886 $as_echo "$as_me: failed program was:" >&5
19887 sed 's/^/| /' conftest.$ac_ext >&5
19888
19889 ac_header_preproc=no
19890 fi
19891
19892 rm -f conftest.err conftest.$ac_ext
19893 { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
19894 $as_echo "$ac_header_preproc" >&6; }
19895
19896 # So? What about this header?
19897 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
19898 yes:no: )
19899 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
19900 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
19901 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
19902 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
19903 ac_header_preproc=yes
19904 ;;
19905 no:yes:* )
19906 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
19907 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
19908 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
19909 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
19910 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
19911 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
19912 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
19913 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
19914 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
19915 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
19916 { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
19917 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
19918 ( cat <<\_ASBOX
19919 ## ---------------------------------------- ##
19920 ## Report this to unbound-bugs@nlnetlabs.nl ##
19921 ## ---------------------------------------- ##
19922 _ASBOX
19923 ) | sed "s/^/$as_me: WARNING: /" >&2
19924 ;;
19925 esac
19926 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
19927 $as_echo_n "checking for $ac_header... " >&6; }
19928 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
19929 $as_echo_n "(cached) " >&6
19930 else
19931 eval "$as_ac_Header=\$ac_header_preproc"
19932 fi
19933 ac_res=`eval 'as_val=${'$as_ac_Header'}
19934 $as_echo "$as_val"'`
19935 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
19936 $as_echo "$ac_res" >&6; }
19937
19938 fi
19939 as_val=`eval 'as_val=${'$as_ac_Header'}
19940 $as_echo "$as_val"'`
19941 if test "x$as_val" = x""yes; then
19942 cat >>confdefs.h <<_ACEOF
19943 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
19944 _ACEOF
19945
19946 fi
19947
19948 done
19949
19950
19951
19952 for ac_func in fork vfork
21551 { $as_echo "$as_me:$LINENO: result: no" >&5
21552 $as_echo "no" >&6; }
21553 fi
21554
21555 rm -rf conftest.dSYM
21556 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21557 conftest$ac_exeext conftest.$ac_ext
21558
21559
21560 # see if daemon(3) exists, and if it is deprecated.
21561
21562 for ac_func in daemon
1995321563 do
1995421564 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1995521565 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
2004921659 fi
2005021660 done
2005121661
20052 if test "x$ac_cv_func_fork" = xyes; then
20053 { $as_echo "$as_me:$LINENO: checking for working fork" >&5
20054 $as_echo_n "checking for working fork... " >&6; }
20055 if test "${ac_cv_func_fork_works+set}" = set; then
21662 if test $ac_cv_func_daemon = yes; then
21663
21664
21665 { $as_echo "$as_me:$LINENO: checking if daemon is deprecated" >&5
21666 $as_echo_n "checking if daemon is deprecated... " >&6; }
21667 cache=`echo daemon | sed 'y%.=/+-%___p_%'`
21668 if { as_var=cv_cc_deprecated_$cache; eval "test \"\${$as_var+set}\" = set"; }; then
2005621669 $as_echo_n "(cached) " >&6
2005721670 else
20058 if test "$cross_compiling" = yes; then
20059 ac_cv_func_fork_works=cross
20060 else
20061 cat >conftest.$ac_ext <<_ACEOF
21671
21672 echo '
21673 #include <stdlib.h>
21674 ' >conftest.c
21675 echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c
21676 if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then
21677 eval "cv_cc_deprecated_$cache=no"
21678 else
21679 eval "cv_cc_deprecated_$cache=yes"
21680 fi
21681 rm -f conftest conftest.o conftest.c
21682
21683 fi
21684
21685 if eval "test \"`echo '$cv_cc_deprecated_'$cache`\" = yes"; then
21686 { $as_echo "$as_me:$LINENO: result: yes" >&5
21687 $as_echo "yes" >&6; }
21688
21689 cat >>confdefs.h <<_ACEOF
21690 #define DEPRECATED_DAEMON 1
21691 _ACEOF
21692
21693 :
21694
21695 else
21696 { $as_echo "$as_me:$LINENO: result: no" >&5
21697 $as_echo "no" >&6; }
21698 :
21699
21700 fi
21701
21702 fi
21703
21704 { $as_echo "$as_me:$LINENO: checking for library containing setusercontext" >&5
21705 $as_echo_n "checking for library containing setusercontext... " >&6; }
21706 if test "${ac_cv_search_setusercontext+set}" = set; then
21707 $as_echo_n "(cached) " >&6
21708 else
21709 ac_func_search_save_LIBS=$LIBS
21710 cat >conftest.$ac_ext <<_ACEOF
2006221711 /* confdefs.h. */
2006321712 _ACEOF
2006421713 cat confdefs.h >>conftest.$ac_ext
2006521714 cat >>conftest.$ac_ext <<_ACEOF
2006621715 /* end confdefs.h. */
20067 $ac_includes_default
21716
21717 /* Override any GCC internal prototype to avoid an error.
21718 Use char because int might match the return type of a GCC
21719 builtin and then its argument prototype would still apply. */
21720 #ifdef __cplusplus
21721 extern "C"
21722 #endif
21723 char setusercontext ();
2006821724 int
2006921725 main ()
2007021726 {
20071
20072 /* By Ruediger Kuhlmann. */
20073 return fork () < 0;
20074
21727 return setusercontext ();
2007521728 ;
2007621729 return 0;
2007721730 }
2007821731 _ACEOF
20079 rm -f conftest$ac_exeext
20080 if { (ac_try="$ac_link"
20081 case "(($ac_try" in
20082 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20083 *) ac_try_echo=$ac_try;;
20084 esac
20085 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20086 $as_echo "$ac_try_echo") >&5
20087 (eval "$ac_link") 2>&5
20088 ac_status=$?
20089 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20090 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20091 { (case "(($ac_try" in
20092 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20093 *) ac_try_echo=$ac_try;;
20094 esac
20095 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20096 $as_echo "$ac_try_echo") >&5
20097 (eval "$ac_try") 2>&5
20098 ac_status=$?
20099 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20100 (exit $ac_status); }; }; then
20101 ac_cv_func_fork_works=yes
20102 else
20103 $as_echo "$as_me: program exited with status $ac_status" >&5
20104 $as_echo "$as_me: failed program was:" >&5
20105 sed 's/^/| /' conftest.$ac_ext >&5
20106
20107 ( exit $ac_status )
20108 ac_cv_func_fork_works=no
20109 fi
20110 rm -rf conftest.dSYM
20111 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20112 fi
20113
20114
20115 fi
20116 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
20117 $as_echo "$ac_cv_func_fork_works" >&6; }
20118
20119 else
20120 ac_cv_func_fork_works=$ac_cv_func_fork
20121 fi
20122 if test "x$ac_cv_func_fork_works" = xcross; then
20123 case $host in
20124 *-*-amigaos* | *-*-msdosdjgpp*)
20125 # Override, as these systems have only a dummy fork() stub
20126 ac_cv_func_fork_works=no
20127 ;;
20128 *)
20129 ac_cv_func_fork_works=yes
20130 ;;
20131 esac
20132 { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5
20133 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;}
20134 fi
20135 ac_cv_func_vfork_works=$ac_cv_func_vfork
20136 if test "x$ac_cv_func_vfork" = xyes; then
20137 { $as_echo "$as_me:$LINENO: checking for working vfork" >&5
20138 $as_echo_n "checking for working vfork... " >&6; }
20139 if test "${ac_cv_func_vfork_works+set}" = set; then
20140 $as_echo_n "(cached) " >&6
20141 else
20142 if test "$cross_compiling" = yes; then
20143 ac_cv_func_vfork_works=cross
20144 else
20145 cat >conftest.$ac_ext <<_ACEOF
20146 /* confdefs.h. */
20147 _ACEOF
20148 cat confdefs.h >>conftest.$ac_ext
20149 cat >>conftest.$ac_ext <<_ACEOF
20150 /* end confdefs.h. */
20151 /* Thanks to Paul Eggert for this test. */
20152 $ac_includes_default
20153 #include <sys/wait.h>
20154 #ifdef HAVE_VFORK_H
20155 # include <vfork.h>
20156 #endif
20157 /* On some sparc systems, changes by the child to local and incoming
20158 argument registers are propagated back to the parent. The compiler
20159 is told about this with #include <vfork.h>, but some compilers
20160 (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a
20161 static variable whose address is put into a register that is
20162 clobbered by the vfork. */
20163 static void
20164 #ifdef __cplusplus
20165 sparc_address_test (int arg)
20166 # else
20167 sparc_address_test (arg) int arg;
20168 #endif
20169 {
20170 static pid_t child;
20171 if (!child) {
20172 child = vfork ();
20173 if (child < 0) {
20174 perror ("vfork");
20175 _exit(2);
20176 }
20177 if (!child) {
20178 arg = getpid();
20179 write(-1, "", 0);
20180 _exit (arg);
20181 }
20182 }
20183 }
20184
20185 int
20186 main ()
20187 {
20188 pid_t parent = getpid ();
20189 pid_t child;
20190
20191 sparc_address_test (0);
20192
20193 child = vfork ();
20194
20195 if (child == 0) {
20196 /* Here is another test for sparc vfork register problems. This
20197 test uses lots of local variables, at least as many local
20198 variables as main has allocated so far including compiler
20199 temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris
20200 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should
20201 reuse the register of parent for one of the local variables,
20202 since it will think that parent can't possibly be used any more
20203 in this routine. Assigning to the local variable will thus
20204 munge parent in the parent process. */
20205 pid_t
20206 p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
20207 p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
20208 /* Convince the compiler that p..p7 are live; otherwise, it might
20209 use the same hardware register for all 8 local variables. */
20210 if (p != p1 || p != p2 || p != p3 || p != p4
20211 || p != p5 || p != p6 || p != p7)
20212 _exit(1);
20213
20214 /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent
20215 from child file descriptors. If the child closes a descriptor
20216 before it execs or exits, this munges the parent's descriptor
20217 as well. Test for this by closing stdout in the child. */
20218 _exit(close(fileno(stdout)) != 0);
20219 } else {
20220 int status;
20221 struct stat st;
20222
20223 while (wait(&status) != child)
20224 ;
20225 return (
20226 /* Was there some problem with vforking? */
20227 child < 0
20228
20229 /* Did the child fail? (This shouldn't happen.) */
20230 || status
20231
20232 /* Did the vfork/compiler bug occur? */
20233 || parent != getpid()
20234
20235 /* Did the file descriptor bug occur? */
20236 || fstat(fileno(stdout), &st) != 0
20237 );
20238 }
20239 }
20240 _ACEOF
20241 rm -f conftest$ac_exeext
20242 if { (ac_try="$ac_link"
20243 case "(($ac_try" in
20244 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20245 *) ac_try_echo=$ac_try;;
20246 esac
20247 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20248 $as_echo "$ac_try_echo") >&5
20249 (eval "$ac_link") 2>&5
20250 ac_status=$?
20251 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20252 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20253 { (case "(($ac_try" in
20254 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20255 *) ac_try_echo=$ac_try;;
20256 esac
20257 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20258 $as_echo "$ac_try_echo") >&5
20259 (eval "$ac_try") 2>&5
20260 ac_status=$?
20261 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20262 (exit $ac_status); }; }; then
20263 ac_cv_func_vfork_works=yes
20264 else
20265 $as_echo "$as_me: program exited with status $ac_status" >&5
20266 $as_echo "$as_me: failed program was:" >&5
20267 sed 's/^/| /' conftest.$ac_ext >&5
20268
20269 ( exit $ac_status )
20270 ac_cv_func_vfork_works=no
20271 fi
20272 rm -rf conftest.dSYM
20273 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20274 fi
20275
20276
20277 fi
20278 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
20279 $as_echo "$ac_cv_func_vfork_works" >&6; }
20280
20281 fi;
20282 if test "x$ac_cv_func_fork_works" = xcross; then
20283 ac_cv_func_vfork_works=$ac_cv_func_vfork
20284 { $as_echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
20285 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
20286 fi
20287
20288 if test "x$ac_cv_func_vfork_works" = xyes; then
20289
20290 cat >>confdefs.h <<\_ACEOF
20291 #define HAVE_WORKING_VFORK 1
20292 _ACEOF
20293
20294 else
20295
20296 cat >>confdefs.h <<\_ACEOF
20297 #define vfork fork
20298 _ACEOF
20299
20300 fi
20301 if test "x$ac_cv_func_fork_works" = xyes; then
20302
20303 cat >>confdefs.h <<\_ACEOF
20304 #define HAVE_WORKING_FORK 1
20305 _ACEOF
20306
20307 fi
20308
20309 { $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
20310 $as_echo_n "checking return type of signal handlers... " >&6; }
20311 if test "${ac_cv_type_signal+set}" = set; then
20312 $as_echo_n "(cached) " >&6
20313 else
20314 cat >conftest.$ac_ext <<_ACEOF
20315 /* confdefs.h. */
20316 _ACEOF
20317 cat confdefs.h >>conftest.$ac_ext
20318 cat >>conftest.$ac_ext <<_ACEOF
20319 /* end confdefs.h. */
20320 #include <sys/types.h>
20321 #include <signal.h>
20322
20323 int
20324 main ()
20325 {
20326 return *(signal (0, 0)) (0) == 1;
20327 ;
20328 return 0;
20329 }
20330 _ACEOF
20331 rm -f conftest.$ac_objext
20332 if { (ac_try="$ac_compile"
20333 case "(($ac_try" in
20334 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20335 *) ac_try_echo=$ac_try;;
20336 esac
20337 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20338 $as_echo "$ac_try_echo") >&5
20339 (eval "$ac_compile") 2>conftest.er1
20340 ac_status=$?
20341 grep -v '^ *+' conftest.er1 >conftest.err
20342 rm -f conftest.er1
20343 cat conftest.err >&5
20344 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20345 (exit $ac_status); } && {
20346 test -z "$ac_c_werror_flag" ||
20347 test ! -s conftest.err
20348 } && test -s conftest.$ac_objext; then
20349 ac_cv_type_signal=int
20350 else
20351 $as_echo "$as_me: failed program was:" >&5
20352 sed 's/^/| /' conftest.$ac_ext >&5
20353
20354 ac_cv_type_signal=void
20355 fi
20356
20357 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20358 fi
20359 { $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
20360 $as_echo "$ac_cv_type_signal" >&6; }
20361
20362 cat >>confdefs.h <<_ACEOF
20363 #define RETSIGTYPE $ac_cv_type_signal
20364 _ACEOF
20365
20366
20367 { $as_echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
20368 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
20369 if test "${ac_cv_sys_largefile_source+set}" = set; then
20370 $as_echo_n "(cached) " >&6
20371 else
20372 while :; do
20373 cat >conftest.$ac_ext <<_ACEOF
20374 /* confdefs.h. */
20375 _ACEOF
20376 cat confdefs.h >>conftest.$ac_ext
20377 cat >>conftest.$ac_ext <<_ACEOF
20378 /* end confdefs.h. */
20379 #include <sys/types.h> /* for off_t */
20380 #include <stdio.h>
20381 int
20382 main ()
20383 {
20384 int (*fp) (FILE *, off_t, int) = fseeko;
20385 return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
20386 ;
20387 return 0;
20388 }
20389 _ACEOF
20390 rm -f conftest.$ac_objext conftest$ac_exeext
21732 for ac_lib in '' util; do
21733 if test -z "$ac_lib"; then
21734 ac_res="none required"
21735 else
21736 ac_res=-l$ac_lib
21737 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21738 fi
21739 rm -f conftest.$ac_objext conftest$ac_exeext
2039121740 if { (ac_try="$ac_link"
2039221741 case "(($ac_try" in
2039321742 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2040821757 test "$cross_compiling" = yes ||
2040921758 $as_test_x conftest$ac_exeext
2041021759 }; then
20411 ac_cv_sys_largefile_source=no; break
21760 ac_cv_search_setusercontext=$ac_res
2041221761 else
2041321762 $as_echo "$as_me: failed program was:" >&5
2041421763 sed 's/^/| /' conftest.$ac_ext >&5
2041821767
2041921768 rm -rf conftest.dSYM
2042021769 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
20421 conftest$ac_exeext conftest.$ac_ext
20422 cat >conftest.$ac_ext <<_ACEOF
20423 /* confdefs.h. */
20424 _ACEOF
20425 cat confdefs.h >>conftest.$ac_ext
20426 cat >>conftest.$ac_ext <<_ACEOF
20427 /* end confdefs.h. */
20428 #define _LARGEFILE_SOURCE 1
20429 #include <sys/types.h> /* for off_t */
20430 #include <stdio.h>
20431 int
20432 main ()
20433 {
20434 int (*fp) (FILE *, off_t, int) = fseeko;
20435 return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
20436 ;
20437 return 0;
20438 }
20439 _ACEOF
20440 rm -f conftest.$ac_objext conftest$ac_exeext
20441 if { (ac_try="$ac_link"
20442 case "(($ac_try" in
20443 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20444 *) ac_try_echo=$ac_try;;
20445 esac
20446 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20447 $as_echo "$ac_try_echo") >&5
20448 (eval "$ac_link") 2>conftest.er1
20449 ac_status=$?
20450 grep -v '^ *+' conftest.er1 >conftest.err
20451 rm -f conftest.er1
20452 cat conftest.err >&5
20453 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20454 (exit $ac_status); } && {
20455 test -z "$ac_c_werror_flag" ||
20456 test ! -s conftest.err
20457 } && test -s conftest$ac_exeext && {
20458 test "$cross_compiling" = yes ||
20459 $as_test_x conftest$ac_exeext
20460 }; then
20461 ac_cv_sys_largefile_source=1; break
20462 else
20463 $as_echo "$as_me: failed program was:" >&5
20464 sed 's/^/| /' conftest.$ac_ext >&5
20465
20466
20467 fi
20468
20469 rm -rf conftest.dSYM
20470 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
20471 conftest$ac_exeext conftest.$ac_ext
20472 ac_cv_sys_largefile_source=unknown
21770 conftest$ac_exeext
21771 if test "${ac_cv_search_setusercontext+set}" = set; then
2047321772 break
21773 fi
2047421774 done
20475 fi
20476 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
20477 $as_echo "$ac_cv_sys_largefile_source" >&6; }
20478 case $ac_cv_sys_largefile_source in #(
20479 no | unknown) ;;
20480 *)
20481 cat >>confdefs.h <<_ACEOF
20482 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
20483 _ACEOF
20484 ;;
20485 esac
20486 rm -rf conftest*
20487
20488 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
20489 # in glibc 2.1.3, but that breaks too many other things.
20490 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
20491 if test $ac_cv_sys_largefile_source != unknown; then
20492
20493 cat >>confdefs.h <<\_ACEOF
20494 #define HAVE_FSEEKO 1
20495 _ACEOF
20496
20497 fi
20498
20499
20500 # Check whether --enable-largefile was given.
20501 if test "${enable_largefile+set}" = set; then
20502 enableval=$enable_largefile;
20503 fi
20504
20505 if test "$enable_largefile" != no; then
20506
20507 { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
20508 $as_echo_n "checking for special C compiler options needed for large files... " >&6; }
20509 if test "${ac_cv_sys_largefile_CC+set}" = set; then
20510 $as_echo_n "(cached) " >&6
20511 else
20512 ac_cv_sys_largefile_CC=no
20513 if test "$GCC" != yes; then
20514 ac_save_CC=$CC
20515 while :; do
20516 # IRIX 6.2 and later do not support large files by default,
20517 # so use the C compiler's -n32 option if that helps.
20518 cat >conftest.$ac_ext <<_ACEOF
20519 /* confdefs.h. */
20520 _ACEOF
20521 cat confdefs.h >>conftest.$ac_ext
20522 cat >>conftest.$ac_ext <<_ACEOF
20523 /* end confdefs.h. */
20524 #include <sys/types.h>
20525 /* Check that off_t can represent 2**63 - 1 correctly.
20526 We can't simply define LARGE_OFF_T to be 9223372036854775807,
20527 since some C++ compilers masquerading as C compilers
20528 incorrectly reject 9223372036854775807. */
20529 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
20530 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
20531 && LARGE_OFF_T % 2147483647 == 1)
20532 ? 1 : -1];
20533 int
20534 main ()
20535 {
20536
20537 ;
20538 return 0;
20539 }
20540 _ACEOF
20541 rm -f conftest.$ac_objext
20542 if { (ac_try="$ac_compile"
20543 case "(($ac_try" in
20544 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20545 *) ac_try_echo=$ac_try;;
20546 esac
20547 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20548 $as_echo "$ac_try_echo") >&5
20549 (eval "$ac_compile") 2>conftest.er1
20550 ac_status=$?
20551 grep -v '^ *+' conftest.er1 >conftest.err
20552 rm -f conftest.er1
20553 cat conftest.err >&5
20554 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20555 (exit $ac_status); } && {
20556 test -z "$ac_c_werror_flag" ||
20557 test ! -s conftest.err
20558 } && test -s conftest.$ac_objext; then
20559 break
20560 else
20561 $as_echo "$as_me: failed program was:" >&5
20562 sed 's/^/| /' conftest.$ac_ext >&5
20563
20564
20565 fi
20566
20567 rm -f core conftest.err conftest.$ac_objext
20568 CC="$CC -n32"
20569 rm -f conftest.$ac_objext
20570 if { (ac_try="$ac_compile"
20571 case "(($ac_try" in
20572 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20573 *) ac_try_echo=$ac_try;;
20574 esac
20575 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20576 $as_echo "$ac_try_echo") >&5
20577 (eval "$ac_compile") 2>conftest.er1
20578 ac_status=$?
20579 grep -v '^ *+' conftest.er1 >conftest.err
20580 rm -f conftest.er1
20581 cat conftest.err >&5
20582 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20583 (exit $ac_status); } && {
20584 test -z "$ac_c_werror_flag" ||
20585 test ! -s conftest.err
20586 } && test -s conftest.$ac_objext; then
20587 ac_cv_sys_largefile_CC=' -n32'; break
20588 else
20589 $as_echo "$as_me: failed program was:" >&5
20590 sed 's/^/| /' conftest.$ac_ext >&5
20591
20592
20593 fi
20594
20595 rm -f core conftest.err conftest.$ac_objext
20596 break
20597 done
20598 CC=$ac_save_CC
20599 rm -f conftest.$ac_ext
20600 fi
20601 fi
20602 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
20603 $as_echo "$ac_cv_sys_largefile_CC" >&6; }
20604 if test "$ac_cv_sys_largefile_CC" != no; then
20605 CC=$CC$ac_cv_sys_largefile_CC
20606 fi
20607
20608 { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
20609 $as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
20610 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
20611 $as_echo_n "(cached) " >&6
20612 else
20613 while :; do
20614 cat >conftest.$ac_ext <<_ACEOF
20615 /* confdefs.h. */
20616 _ACEOF
20617 cat confdefs.h >>conftest.$ac_ext
20618 cat >>conftest.$ac_ext <<_ACEOF
20619 /* end confdefs.h. */
20620 #include <sys/types.h>
20621 /* Check that off_t can represent 2**63 - 1 correctly.
20622 We can't simply define LARGE_OFF_T to be 9223372036854775807,
20623 since some C++ compilers masquerading as C compilers
20624 incorrectly reject 9223372036854775807. */
20625 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
20626 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
20627 && LARGE_OFF_T % 2147483647 == 1)
20628 ? 1 : -1];
20629 int
20630 main ()
20631 {
20632
20633 ;
20634 return 0;
20635 }
20636 _ACEOF
20637 rm -f conftest.$ac_objext
20638 if { (ac_try="$ac_compile"
20639 case "(($ac_try" in
20640 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20641 *) ac_try_echo=$ac_try;;
20642 esac
20643 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20644 $as_echo "$ac_try_echo") >&5
20645 (eval "$ac_compile") 2>conftest.er1
20646 ac_status=$?
20647 grep -v '^ *+' conftest.er1 >conftest.err
20648 rm -f conftest.er1
20649 cat conftest.err >&5
20650 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20651 (exit $ac_status); } && {
20652 test -z "$ac_c_werror_flag" ||
20653 test ! -s conftest.err
20654 } && test -s conftest.$ac_objext; then
20655 ac_cv_sys_file_offset_bits=no; break
20656 else
20657 $as_echo "$as_me: failed program was:" >&5
20658 sed 's/^/| /' conftest.$ac_ext >&5
20659
20660
20661 fi
20662
20663 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20664 cat >conftest.$ac_ext <<_ACEOF
20665 /* confdefs.h. */
20666 _ACEOF
20667 cat confdefs.h >>conftest.$ac_ext
20668 cat >>conftest.$ac_ext <<_ACEOF
20669 /* end confdefs.h. */
20670 #define _FILE_OFFSET_BITS 64
20671 #include <sys/types.h>
20672 /* Check that off_t can represent 2**63 - 1 correctly.
20673 We can't simply define LARGE_OFF_T to be 9223372036854775807,
20674 since some C++ compilers masquerading as C compilers
20675 incorrectly reject 9223372036854775807. */
20676 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
20677 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
20678 && LARGE_OFF_T % 2147483647 == 1)
20679 ? 1 : -1];
20680 int
20681 main ()
20682 {
20683
20684 ;
20685 return 0;
20686 }
20687 _ACEOF
20688 rm -f conftest.$ac_objext
20689 if { (ac_try="$ac_compile"
20690 case "(($ac_try" in
20691 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20692 *) ac_try_echo=$ac_try;;
20693 esac
20694 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20695 $as_echo "$ac_try_echo") >&5
20696 (eval "$ac_compile") 2>conftest.er1
20697 ac_status=$?
20698 grep -v '^ *+' conftest.er1 >conftest.err
20699 rm -f conftest.er1
20700 cat conftest.err >&5
20701 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20702 (exit $ac_status); } && {
20703 test -z "$ac_c_werror_flag" ||
20704 test ! -s conftest.err
20705 } && test -s conftest.$ac_objext; then
20706 ac_cv_sys_file_offset_bits=64; break
20707 else
20708 $as_echo "$as_me: failed program was:" >&5
20709 sed 's/^/| /' conftest.$ac_ext >&5
20710
20711
20712 fi
20713
20714 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20715 ac_cv_sys_file_offset_bits=unknown
20716 break
20717 done
20718 fi
20719 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
20720 $as_echo "$ac_cv_sys_file_offset_bits" >&6; }
20721 case $ac_cv_sys_file_offset_bits in #(
20722 no | unknown) ;;
20723 *)
20724 cat >>confdefs.h <<_ACEOF
20725 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
20726 _ACEOF
20727 ;;
20728 esac
20729 rm -rf conftest*
20730 if test $ac_cv_sys_file_offset_bits = unknown; then
20731 { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
20732 $as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
20733 if test "${ac_cv_sys_large_files+set}" = set; then
20734 $as_echo_n "(cached) " >&6
20735 else
20736 while :; do
20737 cat >conftest.$ac_ext <<_ACEOF
20738 /* confdefs.h. */
20739 _ACEOF
20740 cat confdefs.h >>conftest.$ac_ext
20741 cat >>conftest.$ac_ext <<_ACEOF
20742 /* end confdefs.h. */
20743 #include <sys/types.h>
20744 /* Check that off_t can represent 2**63 - 1 correctly.
20745 We can't simply define LARGE_OFF_T to be 9223372036854775807,
20746 since some C++ compilers masquerading as C compilers
20747 incorrectly reject 9223372036854775807. */
20748 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
20749 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
20750 && LARGE_OFF_T % 2147483647 == 1)
20751 ? 1 : -1];
20752 int
20753 main ()
20754 {
20755
20756 ;
20757 return 0;
20758 }
20759 _ACEOF
20760 rm -f conftest.$ac_objext
20761 if { (ac_try="$ac_compile"
20762 case "(($ac_try" in
20763 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20764 *) ac_try_echo=$ac_try;;
20765 esac
20766 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20767 $as_echo "$ac_try_echo") >&5
20768 (eval "$ac_compile") 2>conftest.er1
20769 ac_status=$?
20770 grep -v '^ *+' conftest.er1 >conftest.err
20771 rm -f conftest.er1
20772 cat conftest.err >&5
20773 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20774 (exit $ac_status); } && {
20775 test -z "$ac_c_werror_flag" ||
20776 test ! -s conftest.err
20777 } && test -s conftest.$ac_objext; then
20778 ac_cv_sys_large_files=no; break
20779 else
20780 $as_echo "$as_me: failed program was:" >&5
20781 sed 's/^/| /' conftest.$ac_ext >&5
20782
20783
20784 fi
20785
20786 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20787 cat >conftest.$ac_ext <<_ACEOF
20788 /* confdefs.h. */
20789 _ACEOF
20790 cat confdefs.h >>conftest.$ac_ext
20791 cat >>conftest.$ac_ext <<_ACEOF
20792 /* end confdefs.h. */
20793 #define _LARGE_FILES 1
20794 #include <sys/types.h>
20795 /* Check that off_t can represent 2**63 - 1 correctly.
20796 We can't simply define LARGE_OFF_T to be 9223372036854775807,
20797 since some C++ compilers masquerading as C compilers
20798 incorrectly reject 9223372036854775807. */
20799 #define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
20800 int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
20801 && LARGE_OFF_T % 2147483647 == 1)
20802 ? 1 : -1];
20803 int
20804 main ()
20805 {
20806
20807 ;
20808 return 0;
20809 }
20810 _ACEOF
20811 rm -f conftest.$ac_objext
20812 if { (ac_try="$ac_compile"
20813 case "(($ac_try" in
20814 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20815 *) ac_try_echo=$ac_try;;
20816 esac
20817 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20818 $as_echo "$ac_try_echo") >&5
20819 (eval "$ac_compile") 2>conftest.er1
20820 ac_status=$?
20821 grep -v '^ *+' conftest.er1 >conftest.err
20822 rm -f conftest.er1
20823 cat conftest.err >&5
20824 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20825 (exit $ac_status); } && {
20826 test -z "$ac_c_werror_flag" ||
20827 test ! -s conftest.err
20828 } && test -s conftest.$ac_objext; then
20829 ac_cv_sys_large_files=1; break
20830 else
20831 $as_echo "$as_me: failed program was:" >&5
20832 sed 's/^/| /' conftest.$ac_ext >&5
20833
20834
20835 fi
20836
20837 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20838 ac_cv_sys_large_files=unknown
20839 break
20840 done
20841 fi
20842 { $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
20843 $as_echo "$ac_cv_sys_large_files" >&6; }
20844 case $ac_cv_sys_large_files in #(
20845 no | unknown) ;;
20846 *)
20847 cat >>confdefs.h <<_ACEOF
20848 #define _LARGE_FILES $ac_cv_sys_large_files
20849 _ACEOF
20850 ;;
20851 esac
20852 rm -rf conftest*
20853 fi
20854 fi
20855
20856
20857
20858
20859 { $as_echo "$as_me:$LINENO: checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC" >&5
20860 $as_echo_n "checking whether we need -D_LARGEFILE_SOURCE=1 as a flag for $CC... " >&6; }
20861 cache=_D_LARGEFILE_SOURCE_1
20862 if { as_var=cv_prog_cc_flag_needed_$cache; eval "test \"\${$as_var+set}\" = set"; }; then
20863 $as_echo_n "(cached) " >&6
20864 else
20865
20866 echo '
20867 #include <stdio.h>
20868 int test() {
20869 int a = fseeko(stdin, 0, 0);
20870 return a;
20871 }
20872 ' > conftest.c
20873 echo 'void f(){}' >>conftest.c
20874 if test -z "`$CC $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
20875 eval "cv_prog_cc_flag_needed_$cache=no"
20876 else
20877
20878 if test -z "`$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`"; then
20879 eval "cv_prog_cc_flag_needed_$cache=yes"
20880 else
20881 eval "cv_prog_cc_flag_needed_$cache=fail"
20882 #echo 'Test with flag fails too!'
20883 #cat conftest.c
20884 #echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1"
20885 #echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`
20886 #exit 1
20887 fi
20888
20889 fi
20890 rm -f conftest conftest.c conftest.o
20891
20892 fi
20893
20894 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
20895 { $as_echo "$as_me:$LINENO: result: yes" >&5
20896 $as_echo "yes" >&6; }
20897 :
20898 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE=1"
20899 else
20900 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
20901 { $as_echo "$as_me:$LINENO: result: no" >&5
20902 $as_echo "no" >&6; }
20903 #echo 'Test with flag is no!'
20904 #cat conftest.c
20905 #echo "$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1"
20906 #echo `$CC $CFLAGS -D_LARGEFILE_SOURCE=1 $ERRFLAG -c conftest.c 2>&1`
20907 #exit 1
20908 :
20909
20910 else
20911 { $as_echo "$as_me:$LINENO: result: failed" >&5
20912 $as_echo "failed" >&6; }
20913 :
20914
20915 fi
20916 fi
20917
20918
20919
20920
20921 { $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5
20922 $as_echo_n "checking for getaddrinfo... " >&6; }
20923 ac_cv_func_getaddrinfo=no
20924 cat >conftest.$ac_ext <<_ACEOF
20925
20926 #ifdef __cplusplus
20927 extern "C"
20928 {
20929 #endif
20930 char* getaddrinfo();
20931 char* (*f) () = getaddrinfo;
20932 #ifdef __cplusplus
20933 }
20934 #endif
20935 int main() {
20936 ;
20937 return 0;
20938 }
20939
20940 _ACEOF
20941 rm -f conftest.$ac_objext conftest$ac_exeext
20942 if { (ac_try="$ac_link"
20943 case "(($ac_try" in
20944 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20945 *) ac_try_echo=$ac_try;;
20946 esac
20947 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20948 $as_echo "$ac_try_echo") >&5
20949 (eval "$ac_link") 2>conftest.er1
20950 ac_status=$?
20951 grep -v '^ *+' conftest.er1 >conftest.err
20952 rm -f conftest.er1
20953 cat conftest.err >&5
20954 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
20955 (exit $ac_status); } && {
20956 test -z "$ac_c_werror_flag" ||
20957 test ! -s conftest.err
20958 } && test -s conftest$ac_exeext && {
20959 test "$cross_compiling" = yes ||
20960 $as_test_x conftest$ac_exeext
20961 }; then
20962 ac_cv_func_getaddrinfo="yes"
20963 else
20964 $as_echo "$as_me: failed program was:" >&5
20965 sed 's/^/| /' conftest.$ac_ext >&5
20966
20967 ORIGLIBS="$LIBS"
20968 LIBS="$LIBS -lws2_32"
20969 cat >conftest.$ac_ext <<_ACEOF
20970 /* confdefs.h. */
20971 _ACEOF
20972 cat confdefs.h >>conftest.$ac_ext
20973 cat >>conftest.$ac_ext <<_ACEOF
20974 /* end confdefs.h. */
20975
20976 #ifdef HAVE_WS2TCPIP_H
20977 #include <ws2tcpip.h>
20978 #endif
20979
20980 int
20981 main ()
20982 {
20983
20984 (void)getaddrinfo(NULL, NULL, NULL, NULL);
20985
20986
20987 ;
20988 return 0;
20989 }
20990 _ACEOF
20991 rm -f conftest.$ac_objext conftest$ac_exeext
20992 if { (ac_try="$ac_link"
20993 case "(($ac_try" in
20994 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
20995 *) ac_try_echo=$ac_try;;
20996 esac
20997 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
20998 $as_echo "$ac_try_echo") >&5
20999 (eval "$ac_link") 2>conftest.er1
21000 ac_status=$?
21001 grep -v '^ *+' conftest.er1 >conftest.err
21002 rm -f conftest.er1
21003 cat conftest.err >&5
21004 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21005 (exit $ac_status); } && {
21006 test -z "$ac_c_werror_flag" ||
21007 test ! -s conftest.err
21008 } && test -s conftest$ac_exeext && {
21009 test "$cross_compiling" = yes ||
21010 $as_test_x conftest$ac_exeext
21011 }; then
21012
21013 ac_cv_func_getaddrinfo="yes"
21014
21015 cat >>confdefs.h <<\_ACEOF
21016 #define USE_WINSOCK 1
21017 _ACEOF
21018
21019 USE_WINSOCK="1"
21020
21021 else
21022 $as_echo "$as_me: failed program was:" >&5
21023 sed 's/^/| /' conftest.$ac_ext >&5
21024
21025
21026 ac_cv_func_getaddrinfo="no"
21027 LIBS="$ORIGLIBS"
21028
21029 fi
21030
21031 rm -rf conftest.dSYM
21032 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21033 conftest$ac_exeext conftest.$ac_ext
21034
21035 fi
21036
21037 rm -rf conftest.dSYM
21038 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21039 conftest$ac_exeext conftest.$ac_ext
21040
21041 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5
21042 $as_echo "$ac_cv_func_getaddrinfo" >&6; }
21043 if test $ac_cv_func_getaddrinfo = yes; then
21044
21045 cat >>confdefs.h <<\_ACEOF
21046 #define HAVE_GETADDRINFO 1
21047 _ACEOF
21048
21049 fi
21050
21051 if test "$USE_WINSOCK" = 1; then
21052
21053 cat >>confdefs.h <<\_ACEOF
21054 #define UB_ON_WINDOWS 1
21055 _ACEOF
21056
21057 UB_ON_WINDOWS=yes
21058
21059
21060 for ac_header in iphlpapi.h
21061 do
21062 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
21063 { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
21064 $as_echo_n "checking for $ac_header... " >&6; }
21065 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
21066 $as_echo_n "(cached) " >&6
21067 else
21068 cat >conftest.$ac_ext <<_ACEOF
21069 /* confdefs.h. */
21070 _ACEOF
21071 cat confdefs.h >>conftest.$ac_ext
21072 cat >>conftest.$ac_ext <<_ACEOF
21073 /* end confdefs.h. */
21074 $ac_includes_default
21075 #include <windows.h>
21076
21077
21078 #include <$ac_header>
21079 _ACEOF
21080 rm -f conftest.$ac_objext
21081 if { (ac_try="$ac_compile"
21082 case "(($ac_try" in
21083 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21084 *) ac_try_echo=$ac_try;;
21085 esac
21086 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21087 $as_echo "$ac_try_echo") >&5
21088 (eval "$ac_compile") 2>conftest.er1
21089 ac_status=$?
21090 grep -v '^ *+' conftest.er1 >conftest.err
21091 rm -f conftest.er1
21092 cat conftest.err >&5
21093 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21094 (exit $ac_status); } && {
21095 test -z "$ac_c_werror_flag" ||
21096 test ! -s conftest.err
21097 } && test -s conftest.$ac_objext; then
21098 eval "$as_ac_Header=yes"
21099 else
21100 $as_echo "$as_me: failed program was:" >&5
21101 sed 's/^/| /' conftest.$ac_ext >&5
21102
21103 eval "$as_ac_Header=no"
21104 fi
21105
21106 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21107 fi
21108 ac_res=`eval 'as_val=${'$as_ac_Header'}
21109 $as_echo "$as_val"'`
21110 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
21111 $as_echo "$ac_res" >&6; }
21112 as_val=`eval 'as_val=${'$as_ac_Header'}
21113 $as_echo "$as_val"'`
21114 if test "x$as_val" = x""yes; then
21115 cat >>confdefs.h <<_ACEOF
21116 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
21117 _ACEOF
21118
21119 fi
21120
21121 done
21122
21123 if test -n "$ac_tool_prefix"; then
21124 # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
21125 set dummy ${ac_tool_prefix}windres; ac_word=$2
21126 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
21127 $as_echo_n "checking for $ac_word... " >&6; }
21128 if test "${ac_cv_prog_WINDRES+set}" = set; then
21129 $as_echo_n "(cached) " >&6
21130 else
21131 if test -n "$WINDRES"; then
21132 ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test.
21133 else
21134 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
21135 for as_dir in $PATH
21136 do
21137 IFS=$as_save_IFS
21138 test -z "$as_dir" && as_dir=.
21139 for ac_exec_ext in '' $ac_executable_extensions; do
21140 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
21141 ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
21142 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
21143 break 2
21144 fi
21145 done
21146 done
21147 IFS=$as_save_IFS
21148
21149 fi
21150 fi
21151 WINDRES=$ac_cv_prog_WINDRES
21152 if test -n "$WINDRES"; then
21153 { $as_echo "$as_me:$LINENO: result: $WINDRES" >&5
21154 $as_echo "$WINDRES" >&6; }
21155 else
21156 { $as_echo "$as_me:$LINENO: result: no" >&5
21157 $as_echo "no" >&6; }
21158 fi
21159
21160
21161 fi
21162 if test -z "$ac_cv_prog_WINDRES"; then
21163 ac_ct_WINDRES=$WINDRES
21164 # Extract the first word of "windres", so it can be a program name with args.
21165 set dummy windres; ac_word=$2
21166 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
21167 $as_echo_n "checking for $ac_word... " >&6; }
21168 if test "${ac_cv_prog_ac_ct_WINDRES+set}" = set; then
21169 $as_echo_n "(cached) " >&6
21170 else
21171 if test -n "$ac_ct_WINDRES"; then
21172 ac_cv_prog_ac_ct_WINDRES="$ac_ct_WINDRES" # Let the user override the test.
21173 else
21174 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
21175 for as_dir in $PATH
21176 do
21177 IFS=$as_save_IFS
21178 test -z "$as_dir" && as_dir=.
21179 for ac_exec_ext in '' $ac_executable_extensions; do
21180 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
21181 ac_cv_prog_ac_ct_WINDRES="windres"
21182 $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
21183 break 2
21184 fi
21185 done
21186 done
21187 IFS=$as_save_IFS
21188
21189 fi
21190 fi
21191 ac_ct_WINDRES=$ac_cv_prog_ac_ct_WINDRES
21192 if test -n "$ac_ct_WINDRES"; then
21193 { $as_echo "$as_me:$LINENO: result: $ac_ct_WINDRES" >&5
21194 $as_echo "$ac_ct_WINDRES" >&6; }
21195 else
21196 { $as_echo "$as_me:$LINENO: result: no" >&5
21197 $as_echo "no" >&6; }
21198 fi
21199
21200 if test "x$ac_ct_WINDRES" = x; then
21201 WINDRES=""
21202 else
21203 case $cross_compiling:$ac_tool_warned in
21204 yes:)
21205 { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
21206 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
21207 ac_tool_warned=yes ;;
21208 esac
21209 WINDRES=$ac_ct_WINDRES
21210 fi
21211 else
21212 WINDRES="$ac_cv_prog_WINDRES"
21213 fi
21214
21215 LIBS="$LIBS -liphlpapi"
21216 fi
21217 if test $ac_cv_func_getaddrinfo = no; then
21218 case " $LIBOBJS " in
21219 *" fake-rfc2553.$ac_objext "* ) ;;
21220 *) LIBOBJS="$LIBOBJS fake-rfc2553.$ac_objext"
21221 ;;
21222 esac
21223
21224 fi
21225
21226 # see if daemon(3) exists, and if it is deprecated.
21227
21228 for ac_func in daemon
21775 if test "${ac_cv_search_setusercontext+set}" = set; then
21776 :
21777 else
21778 ac_cv_search_setusercontext=no
21779 fi
21780 rm conftest.$ac_ext
21781 LIBS=$ac_func_search_save_LIBS
21782 fi
21783 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_setusercontext" >&5
21784 $as_echo "$ac_cv_search_setusercontext" >&6; }
21785 ac_res=$ac_cv_search_setusercontext
21786 if test "$ac_res" != no; then
21787 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21788
21789 fi
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813 for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev glob initgroups strftime localtime_r setusercontext _beginthreadex
2122921814 do
2123021815 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
2123121816 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
2132521910 fi
2132621911 done
2132721912
21328 if test $ac_cv_func_daemon = yes; then
21329
21330
21331 { $as_echo "$as_me:$LINENO: checking if daemon is deprecated" >&5
21332 $as_echo_n "checking if daemon is deprecated... " >&6; }
21333 cache=`echo daemon | sed 'y%.=/+-%___p_%'`
21334 if { as_var=cv_cc_deprecated_$cache; eval "test \"\${$as_var+set}\" = set"; }; then
21335 $as_echo_n "(cached) " >&6
21336 else
21337
21338 echo '
21339 #include <stdlib.h>
21340 ' >conftest.c
21341 echo 'void f(){ (void)daemon(0, 0); }' >>conftest.c
21342 if test -z "`$CC -c conftest.c 2>&1 | grep deprecated`"; then
21343 eval "cv_cc_deprecated_$cache=no"
21344 else
21345 eval "cv_cc_deprecated_$cache=yes"
21346 fi
21347 rm -f conftest conftest.o conftest.c
21348
21349 fi
21350
21351 if eval "test \"`echo '$cv_cc_deprecated_'$cache`\" = yes"; then
21352 { $as_echo "$as_me:$LINENO: result: yes" >&5
21353 $as_echo "yes" >&6; }
21354
21355 cat >>confdefs.h <<_ACEOF
21356 #define DEPRECATED_DAEMON 1
21357 _ACEOF
21358
21359 :
21360
21361 else
21362 { $as_echo "$as_me:$LINENO: result: no" >&5
21363 $as_echo "no" >&6; }
21364 :
21365
21366 fi
21367
21368 fi
21369
21370 { $as_echo "$as_me:$LINENO: checking for library containing setusercontext" >&5
21371 $as_echo_n "checking for library containing setusercontext... " >&6; }
21372 if test "${ac_cv_search_setusercontext+set}" = set; then
21373 $as_echo_n "(cached) " >&6
21374 else
21375 ac_func_search_save_LIBS=$LIBS
21376 cat >conftest.$ac_ext <<_ACEOF
21377 /* confdefs.h. */
21378 _ACEOF
21379 cat confdefs.h >>conftest.$ac_ext
21380 cat >>conftest.$ac_ext <<_ACEOF
21381 /* end confdefs.h. */
21382
21383 /* Override any GCC internal prototype to avoid an error.
21384 Use char because int might match the return type of a GCC
21385 builtin and then its argument prototype would still apply. */
21386 #ifdef __cplusplus
21387 extern "C"
21388 #endif
21389 char setusercontext ();
21390 int
21391 main ()
21392 {
21393 return setusercontext ();
21394 ;
21395 return 0;
21396 }
21397 _ACEOF
21398 for ac_lib in '' util; do
21399 if test -z "$ac_lib"; then
21400 ac_res="none required"
21401 else
21402 ac_res=-l$ac_lib
21403 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
21404 fi
21405 rm -f conftest.$ac_objext conftest$ac_exeext
21406 if { (ac_try="$ac_link"
21407 case "(($ac_try" in
21408 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21409 *) ac_try_echo=$ac_try;;
21410 esac
21411 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21412 $as_echo "$ac_try_echo") >&5
21413 (eval "$ac_link") 2>conftest.er1
21414 ac_status=$?
21415 grep -v '^ *+' conftest.er1 >conftest.err
21416 rm -f conftest.er1
21417 cat conftest.err >&5
21418 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21419 (exit $ac_status); } && {
21420 test -z "$ac_c_werror_flag" ||
21421 test ! -s conftest.err
21422 } && test -s conftest$ac_exeext && {
21423 test "$cross_compiling" = yes ||
21424 $as_test_x conftest$ac_exeext
21425 }; then
21426 ac_cv_search_setusercontext=$ac_res
21427 else
21428 $as_echo "$as_me: failed program was:" >&5
21429 sed 's/^/| /' conftest.$ac_ext >&5
21430
21431
21432 fi
21433
21434 rm -rf conftest.dSYM
21435 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
21436 conftest$ac_exeext
21437 if test "${ac_cv_search_setusercontext+set}" = set; then
21438 break
21439 fi
21440 done
21441 if test "${ac_cv_search_setusercontext+set}" = set; then
21442 :
21443 else
21444 ac_cv_search_setusercontext=no
21445 fi
21446 rm conftest.$ac_ext
21447 LIBS=$ac_func_search_save_LIBS
21448 fi
21449 { $as_echo "$as_me:$LINENO: result: $ac_cv_search_setusercontext" >&5
21450 $as_echo "$ac_cv_search_setusercontext" >&6; }
21451 ac_res=$ac_cv_search_setusercontext
21452 if test "$ac_res" != no; then
21453 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
21454
21455 fi
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483 for ac_func in tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups strftime localtime_r setusercontext _beginthreadex
21913
21914 for ac_func in setresuid
2148421915 do
2148521916 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
2148621917 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
2157722008 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
2157822009 _ACEOF
2157922010
21580 fi
21581 done
21582
21583
21584 # check if setreuid en setregid fail, on MacOSX10.4(darwin8).
21585 if echo $build_os | grep darwin8 > /dev/null; then
21586
21587 cat >>confdefs.h <<\_ACEOF
21588 #define DARWIN_BROKEN_SETREUID 1
21589 _ACEOF
21590
21591 fi
21592
21593 { $as_echo "$as_me:$LINENO: checking if nonblocking sockets work" >&5
21594 $as_echo_n "checking if nonblocking sockets work... " >&6; }
21595 if echo $target | grep mingw32 >/dev/null; then
21596 { $as_echo "$as_me:$LINENO: result: no (windows)" >&5
21597 $as_echo "no (windows)" >&6; }
21598
21599 cat >>confdefs.h <<\_ACEOF
21600 #define NONBLOCKING_IS_BROKEN 1
21601 _ACEOF
21602
21603 else
21604 if test "$cross_compiling" = yes; then
21605
21606 { $as_echo "$as_me:$LINENO: result: crosscompile(yes)" >&5
21607 $as_echo "crosscompile(yes)" >&6; }
21608
22011 else
22012
22013 for ac_func in setreuid
22014 do
22015 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
22016 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
22017 $as_echo_n "checking for $ac_func... " >&6; }
22018 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
22019 $as_echo_n "(cached) " >&6
2160922020 else
2161022021 cat >conftest.$ac_ext <<_ACEOF
2161122022 /* confdefs.h. */
2161322024 cat confdefs.h >>conftest.$ac_ext
2161422025 cat >>conftest.$ac_ext <<_ACEOF
2161522026 /* end confdefs.h. */
21616
21617 #include <stdio.h>
21618 #include <string.h>
21619 #include <stdlib.h>
21620 #include <fcntl.h>
21621 #include <errno.h>
21622 #ifdef HAVE_SYS_TYPES_H
21623 #include <sys/types.h>
22027 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
22028 For example, HP-UX 11i <limits.h> declares gettimeofday. */
22029 #define $ac_func innocuous_$ac_func
22030
22031 /* System header to define __stub macros and hopefully few prototypes,
22032 which can conflict with char $ac_func (); below.
22033 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
22034 <limits.h> exists even on freestanding compilers. */
22035
22036 #ifdef __STDC__
22037 # include <limits.h>
22038 #else
22039 # include <assert.h>
2162422040 #endif
21625 #ifdef HAVE_SYS_SOCKET_H
21626 #include <sys/socket.h>
22041
22042 #undef $ac_func
22043
22044 /* Override any GCC internal prototype to avoid an error.
22045 Use char because int might match the return type of a GCC
22046 builtin and then its argument prototype would still apply. */
22047 #ifdef __cplusplus
22048 extern "C"
2162722049 #endif
21628 #ifdef HAVE_NETINET_IN_H
21629 #include <netinet/in.h>
21630 #endif
21631 #ifdef HAVE_ARPA_INET_H
21632 #include <arpa/inet.h>
21633 #endif
21634 #ifdef HAVE_UNISTD_H
21635 #include <unistd.h>
21636 #endif
21637 #ifdef HAVE_TIME_H
21638 #include <time.h>
22050 char $ac_func ();
22051 /* The GNU C library defines this for functions which it implements
22052 to always fail with ENOSYS. Some functions are actually named
22053 something starting with __ and the normal name is an alias. */
22054 #if defined __stub_$ac_func || defined __stub___$ac_func
22055 choke me
2163922056 #endif
2164022057
2164122058 int
2164222059 main ()
2164322060 {
21644
21645 int port;
21646 int sfd, cfd;
21647 int num = 10;
21648 int i, p;
21649 struct sockaddr_in a;
21650 /* test if select and nonblocking reads work well together */
21651 /* open port.
21652 fork child to send 10 messages.
21653 select to read.
21654 then try to nonblocking read the 10 messages
21655 then, nonblocking read must give EAGAIN
21656 */
21657
21658 port = 12345 + (time(0)%32);
21659 sfd = socket(PF_INET, SOCK_DGRAM, 0);
21660 if(sfd == -1) {
21661 perror("socket");
21662 return 1;
21663 }
21664 memset(&a, 0, sizeof(a));
21665 a.sin_family = AF_INET;
21666 a.sin_port = htons(port);
21667 a.sin_addr.s_addr = inet_addr("127.0.0.1");
21668 if(bind(sfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
21669 perror("bind");
21670 return 1;
21671 }
21672 if(fcntl(sfd, F_SETFL, O_NONBLOCK) == -1) {
21673 perror("fcntl");
21674 return 1;
21675 }
21676
21677 cfd = socket(PF_INET, SOCK_DGRAM, 0);
21678 if(cfd == -1) {
21679 perror("client socket");
21680 return 1;
21681 }
21682 a.sin_port = 0;
21683 if(bind(cfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
21684 perror("client bind");
21685 return 1;
21686 }
21687 a.sin_port = htons(port);
21688
21689 /* no handler, causes exit in 10 seconds */
21690 alarm(10);
21691
21692 /* send and receive on the socket */
21693 if((p=fork()) == 0) {
21694 for(i=0; i<num; i++) {
21695 if(sendto(cfd, &i, sizeof(i), 0,
21696 (struct sockaddr*)&a, sizeof(a)) < 0) {
21697 perror("sendto");
21698 return 1;
21699 }
21700 }
21701 } else {
21702 /* parent */
21703 fd_set rset;
21704 int x;
21705 if(p == -1) {
21706 perror("fork");
21707 return 1;
21708 }
21709 FD_ZERO(&rset);
21710 FD_SET(sfd, &rset);
21711 if(select(sfd+1, &rset, NULL, NULL, NULL) < 1) {
21712 perror("select");
21713 return 1;
21714 }
21715 i = 0;
21716 while(i < num) {
21717 if(recv(sfd, &x, sizeof(x), 0) != sizeof(x)) {
21718 if(errno == EAGAIN)
21719 continue;
21720 perror("recv");
21721 return 1;
21722 }
21723 i++;
21724 }
21725 /* now we want to get EAGAIN: nonblocking goodness */
21726 errno = 0;
21727 recv(sfd, &x, sizeof(x), 0);
21728 if(errno != EAGAIN) {
21729 perror("trying to recv again");
21730 return 1;
21731 }
21732 /* EAGAIN encountered */
21733 }
21734
21735 close(sfd);
21736 close(cfd);
21737
21738 ;
21739 return 0;
21740 }
21741 _ACEOF
21742 rm -f conftest$ac_exeext
21743 if { (ac_try="$ac_link"
21744 case "(($ac_try" in
21745 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21746 *) ac_try_echo=$ac_try;;
21747 esac
21748 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21749 $as_echo "$ac_try_echo") >&5
21750 (eval "$ac_link") 2>&5
21751 ac_status=$?
21752 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21753 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
21754 { (case "(($ac_try" in
21755 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21756 *) ac_try_echo=$ac_try;;
21757 esac
21758 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21759 $as_echo "$ac_try_echo") >&5
21760 (eval "$ac_try") 2>&5
21761 ac_status=$?
21762 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21763 (exit $ac_status); }; }; then
21764
21765 { $as_echo "$as_me:$LINENO: result: yes" >&5
21766 $as_echo "yes" >&6; }
21767
21768 else
21769 $as_echo "$as_me: program exited with status $ac_status" >&5
21770 $as_echo "$as_me: failed program was:" >&5
21771 sed 's/^/| /' conftest.$ac_ext >&5
21772
21773 ( exit $ac_status )
21774
21775 { $as_echo "$as_me:$LINENO: result: no" >&5
21776 $as_echo "no" >&6; }
21777
21778 cat >>confdefs.h <<\_ACEOF
21779 #define NONBLOCKING_IS_BROKEN 1
21780 _ACEOF
21781
21782
21783 fi
21784 rm -rf conftest.dSYM
21785 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
21786 fi
21787
21788
21789 fi
21790
21791
21792 { $as_echo "$as_me:$LINENO: checking whether mkdir has one arg" >&5
21793 $as_echo_n "checking whether mkdir has one arg... " >&6; }
21794 cat >conftest.$ac_ext <<_ACEOF
21795 /* confdefs.h. */
21796 _ACEOF
21797 cat confdefs.h >>conftest.$ac_ext
21798 cat >>conftest.$ac_ext <<_ACEOF
21799 /* end confdefs.h. */
21800
21801 #include <stdio.h>
21802 #include <unistd.h>
21803 #ifdef HAVE_WINSOCK2_H
21804 #include <winsock2.h>
21805 #endif
21806 #ifdef HAVE_SYS_STAT_H
21807 #include <sys/stat.h>
21808 #endif
21809
21810 int
21811 main ()
21812 {
21813
21814 (void)mkdir("directory");
21815
21816 ;
21817 return 0;
21818 }
21819 _ACEOF
21820 rm -f conftest.$ac_objext
21821 if { (ac_try="$ac_compile"
21822 case "(($ac_try" in
21823 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
21824 *) ac_try_echo=$ac_try;;
21825 esac
21826 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
21827 $as_echo "$ac_try_echo") >&5
21828 (eval "$ac_compile") 2>conftest.er1
21829 ac_status=$?
21830 grep -v '^ *+' conftest.er1 >conftest.err
21831 rm -f conftest.er1
21832 cat conftest.err >&5
21833 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
21834 (exit $ac_status); } && {
21835 test -z "$ac_c_werror_flag" ||
21836 test ! -s conftest.err
21837 } && test -s conftest.$ac_objext; then
21838 { $as_echo "$as_me:$LINENO: result: yes" >&5
21839 $as_echo "yes" >&6; }
21840
21841 cat >>confdefs.h <<\_ACEOF
21842 #define MKDIR_HAS_ONE_ARG 1
21843 _ACEOF
21844
21845
21846 else
21847 $as_echo "$as_me: failed program was:" >&5
21848 sed 's/^/| /' conftest.$ac_ext >&5
21849
21850 { $as_echo "$as_me:$LINENO: result: no" >&5
21851 $as_echo "no" >&6; }
21852
21853 fi
21854
21855 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
21856
21857
21858 # check ioctlsocket
21859 { $as_echo "$as_me:$LINENO: checking for ioctlsocket" >&5
21860 $as_echo_n "checking for ioctlsocket... " >&6; }
21861 cat >conftest.$ac_ext <<_ACEOF
21862 /* confdefs.h. */
21863 _ACEOF
21864 cat confdefs.h >>conftest.$ac_ext
21865 cat >>conftest.$ac_ext <<_ACEOF
21866 /* end confdefs.h. */
21867
21868 #ifdef HAVE_WINSOCK2_H
21869 #include <winsock2.h>
21870 #endif
21871
21872 int
21873 main ()
21874 {
21875
21876 (void)ioctlsocket(0, 0, NULL);
21877
22061 return $ac_func ();
2187822062 ;
2187922063 return 0;
2188022064 }
2190022084 test "$cross_compiling" = yes ||
2190122085 $as_test_x conftest$ac_exeext
2190222086 }; then
21903
21904 { $as_echo "$as_me:$LINENO: result: yes" >&5
21905 $as_echo "yes" >&6; }
21906
21907 cat >>confdefs.h <<\_ACEOF
21908 #define HAVE_IOCTLSOCKET 1
21909 _ACEOF
21910
21911
22087 eval "$as_ac_var=yes"
2191222088 else
2191322089 $as_echo "$as_me: failed program was:" >&5
2191422090 sed 's/^/| /' conftest.$ac_ext >&5
2191522091
21916 { $as_echo "$as_me:$LINENO: result: no" >&5
21917 $as_echo "no" >&6; }
22092 eval "$as_ac_var=no"
2191822093 fi
2191922094
2192022095 rm -rf conftest.dSYM
2192122096 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
2192222097 conftest$ac_exeext conftest.$ac_ext
21923
22098 fi
22099 ac_res=`eval 'as_val=${'$as_ac_var'}
22100 $as_echo "$as_val"'`
22101 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22102 $as_echo "$ac_res" >&6; }
22103 as_val=`eval 'as_val=${'$as_ac_var'}
22104 $as_echo "$as_val"'`
22105 if test "x$as_val" = x""yes; then
22106 cat >>confdefs.h <<_ACEOF
22107 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
22108 _ACEOF
22109
22110 fi
22111 done
22112
22113 fi
22114 done
22115
22116
22117 for ac_func in setresgid
22118 do
22119 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
22120 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
22121 $as_echo_n "checking for $ac_func... " >&6; }
22122 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
22123 $as_echo_n "(cached) " >&6
22124 else
22125 cat >conftest.$ac_ext <<_ACEOF
22126 /* confdefs.h. */
22127 _ACEOF
22128 cat confdefs.h >>conftest.$ac_ext
22129 cat >>conftest.$ac_ext <<_ACEOF
22130 /* end confdefs.h. */
22131 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
22132 For example, HP-UX 11i <limits.h> declares gettimeofday. */
22133 #define $ac_func innocuous_$ac_func
22134
22135 /* System header to define __stub macros and hopefully few prototypes,
22136 which can conflict with char $ac_func (); below.
22137 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
22138 <limits.h> exists even on freestanding compilers. */
22139
22140 #ifdef __STDC__
22141 # include <limits.h>
22142 #else
22143 # include <assert.h>
22144 #endif
22145
22146 #undef $ac_func
22147
22148 /* Override any GCC internal prototype to avoid an error.
22149 Use char because int might match the return type of a GCC
22150 builtin and then its argument prototype would still apply. */
22151 #ifdef __cplusplus
22152 extern "C"
22153 #endif
22154 char $ac_func ();
22155 /* The GNU C library defines this for functions which it implements
22156 to always fail with ENOSYS. Some functions are actually named
22157 something starting with __ and the normal name is an alias. */
22158 #if defined __stub_$ac_func || defined __stub___$ac_func
22159 choke me
22160 #endif
22161
22162 int
22163 main ()
22164 {
22165 return $ac_func ();
22166 ;
22167 return 0;
22168 }
22169 _ACEOF
22170 rm -f conftest.$ac_objext conftest$ac_exeext
22171 if { (ac_try="$ac_link"
22172 case "(($ac_try" in
22173 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22174 *) ac_try_echo=$ac_try;;
22175 esac
22176 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22177 $as_echo "$ac_try_echo") >&5
22178 (eval "$ac_link") 2>conftest.er1
22179 ac_status=$?
22180 grep -v '^ *+' conftest.er1 >conftest.err
22181 rm -f conftest.er1
22182 cat conftest.err >&5
22183 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22184 (exit $ac_status); } && {
22185 test -z "$ac_c_werror_flag" ||
22186 test ! -s conftest.err
22187 } && test -s conftest$ac_exeext && {
22188 test "$cross_compiling" = yes ||
22189 $as_test_x conftest$ac_exeext
22190 }; then
22191 eval "$as_ac_var=yes"
22192 else
22193 $as_echo "$as_me: failed program was:" >&5
22194 sed 's/^/| /' conftest.$ac_ext >&5
22195
22196 eval "$as_ac_var=no"
22197 fi
22198
22199 rm -rf conftest.dSYM
22200 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22201 conftest$ac_exeext conftest.$ac_ext
22202 fi
22203 ac_res=`eval 'as_val=${'$as_ac_var'}
22204 $as_echo "$as_val"'`
22205 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22206 $as_echo "$ac_res" >&6; }
22207 as_val=`eval 'as_val=${'$as_ac_var'}
22208 $as_echo "$as_val"'`
22209 if test "x$as_val" = x""yes; then
22210 cat >>confdefs.h <<_ACEOF
22211 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
22212 _ACEOF
22213
22214 else
22215
22216 for ac_func in setregid
22217 do
22218 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
22219 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
22220 $as_echo_n "checking for $ac_func... " >&6; }
22221 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
22222 $as_echo_n "(cached) " >&6
22223 else
22224 cat >conftest.$ac_ext <<_ACEOF
22225 /* confdefs.h. */
22226 _ACEOF
22227 cat confdefs.h >>conftest.$ac_ext
22228 cat >>conftest.$ac_ext <<_ACEOF
22229 /* end confdefs.h. */
22230 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
22231 For example, HP-UX 11i <limits.h> declares gettimeofday. */
22232 #define $ac_func innocuous_$ac_func
22233
22234 /* System header to define __stub macros and hopefully few prototypes,
22235 which can conflict with char $ac_func (); below.
22236 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
22237 <limits.h> exists even on freestanding compilers. */
22238
22239 #ifdef __STDC__
22240 # include <limits.h>
22241 #else
22242 # include <assert.h>
22243 #endif
22244
22245 #undef $ac_func
22246
22247 /* Override any GCC internal prototype to avoid an error.
22248 Use char because int might match the return type of a GCC
22249 builtin and then its argument prototype would still apply. */
22250 #ifdef __cplusplus
22251 extern "C"
22252 #endif
22253 char $ac_func ();
22254 /* The GNU C library defines this for functions which it implements
22255 to always fail with ENOSYS. Some functions are actually named
22256 something starting with __ and the normal name is an alias. */
22257 #if defined __stub_$ac_func || defined __stub___$ac_func
22258 choke me
22259 #endif
22260
22261 int
22262 main ()
22263 {
22264 return $ac_func ();
22265 ;
22266 return 0;
22267 }
22268 _ACEOF
22269 rm -f conftest.$ac_objext conftest$ac_exeext
22270 if { (ac_try="$ac_link"
22271 case "(($ac_try" in
22272 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22273 *) ac_try_echo=$ac_try;;
22274 esac
22275 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22276 $as_echo "$ac_try_echo") >&5
22277 (eval "$ac_link") 2>conftest.er1
22278 ac_status=$?
22279 grep -v '^ *+' conftest.er1 >conftest.err
22280 rm -f conftest.er1
22281 cat conftest.err >&5
22282 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22283 (exit $ac_status); } && {
22284 test -z "$ac_c_werror_flag" ||
22285 test ! -s conftest.err
22286 } && test -s conftest$ac_exeext && {
22287 test "$cross_compiling" = yes ||
22288 $as_test_x conftest$ac_exeext
22289 }; then
22290 eval "$as_ac_var=yes"
22291 else
22292 $as_echo "$as_me: failed program was:" >&5
22293 sed 's/^/| /' conftest.$ac_ext >&5
22294
22295 eval "$as_ac_var=no"
22296 fi
22297
22298 rm -rf conftest.dSYM
22299 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22300 conftest$ac_exeext conftest.$ac_ext
22301 fi
22302 ac_res=`eval 'as_val=${'$as_ac_var'}
22303 $as_echo "$as_val"'`
22304 { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
22305 $as_echo "$ac_res" >&6; }
22306 as_val=`eval 'as_val=${'$as_ac_var'}
22307 $as_echo "$as_val"'`
22308 if test "x$as_val" = x""yes; then
22309 cat >>confdefs.h <<_ACEOF
22310 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
22311 _ACEOF
22312
22313 fi
22314 done
22315
22316 fi
22317 done
22318
22319
22320 # check if setreuid en setregid fail, on MacOSX10.4(darwin8).
22321 if echo $build_os | grep darwin8 > /dev/null; then
22322
22323 cat >>confdefs.h <<\_ACEOF
22324 #define DARWIN_BROKEN_SETREUID 1
22325 _ACEOF
22326
22327 fi
2192422328
2192522329 for ac_func in inet_aton
2192622330 do
2369624100 # report actual input values of CONFIG_FILES etc. instead of their
2369724101 # values after options handling.
2369824102 ac_log="
23699 This file was extended by unbound $as_me 1.4.3, which was
24103 This file was extended by unbound $as_me 1.4.4, which was
2370024104 generated by GNU Autoconf 2.63. Invocation command line was
2370124105
2370224106 CONFIG_FILES = $CONFIG_FILES
2375924163 _ACEOF
2376024164 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2376124165 ac_cs_version="\\
23762 unbound config.status 1.4.3
24166 unbound config.status 1.4.4
2376324167 configured by $0, generated by GNU Autoconf 2.63,
2376424168 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2376524169
55 sinclude(acx_python.m4)
66 sinclude(ac_pkg_swig.m4)
77
8 AC_INIT(unbound, 1.4.3, unbound-bugs@nlnetlabs.nl, unbound)
8 AC_INIT(unbound, 1.4.4, unbound-bugs@nlnetlabs.nl, unbound)
99
1010 LIBUNBOUND_CURRENT=2
11 LIBUNBOUND_REVISION=3
11 LIBUNBOUND_REVISION=4
1212 LIBUNBOUND_AGE=0
1313 # 1.0.0 had 0:12:0
1414 # 1.0.1 had 0:13:0
2727 # 1.4.1 had 2:1:0
2828 # 1.4.2 had 2:2:0
2929 # 1.4.3 had 2:3:0
30 # 1.4.4 had 2:4:0
3031
3132 # Current -- the number of the binary API that we're implementing
3233 # Revision -- which iteration of the implementation of the binary
230231
231232 # add option to disable the evil rpath
232233 ACX_ARG_RPATH
234 AC_SUBST(RUNTIME_PATH)
235
236 # check to see if libraries are needed for these functions.
237 AC_SEARCH_LIBS([inet_pton], [nsl])
238 AC_SEARCH_LIBS([socket], [socket])
239
240 # check some functions of the OS before linking libs (while still runnable).
241 AC_FUNC_CHOWN
242 AC_FUNC_FORK
243 AC_TYPE_SIGNAL
244 AC_FUNC_FSEEKO
245 ACX_SYS_LARGEFILE
246 ACX_CHECK_NONBLOCKING_BROKEN
247 ACX_MKDIR_ONE_ARG
233248
234249 # check for thread library.
235250 # check this first, so that the pthread lib does not get linked in via
319334
320335 # Check for Python
321336 ub_have_python=no
337 ac_save_LIBS="$LIBS" dnl otherwise AC_PYTHON_DEVEL thrashes $LIBS
322338 AC_PYTHON_DEVEL
323339 if test ! -z "$PYTHON_VERSION"; then
324340 if test `$PYTHON -c "print '$PYTHON_VERSION' >= '2.4.0'"` = "False"; then
403419 AC_ARG_ENABLE(gost, AC_HELP_STRING([--enable-gost], [Enable GOST support, experimental]))
404420 case "$enable_gost" in
405421 yes)
406 AC_CHECK_FUNC(EVP_PKEY_set_type_str, [:],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support])])
422 AC_CHECK_FUNC(EVP_PKEY_set_type_str, [:],[AC_MSG_ERROR([OpenSSL >= 1.0.0 is needed for GOST support, upgrade openssl or rerun with --disable-gost])])
407423 AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.])
408424 ;;
409425 no|*)
410426 ;;
411427 esac
412
413 # check to see if libraries are needed for these functions.
414 AC_SEARCH_LIBS([inet_pton], [nsl])
415 AC_SEARCH_LIBS([socket], [socket])
416
417 AC_SUBST(RUNTIME_PATH)
418428
419429 # check for libevent
420430 AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
536546 fi
537547 fi
538548
539 AC_FUNC_CHOWN
540 AC_FUNC_FORK
541 AC_TYPE_SIGNAL
542 AC_FUNC_FSEEKO
543 ACX_SYS_LARGEFILE
544
545549 ACX_CHECK_GETADDRINFO_WITH_INCLUDES
546550 if test "$USE_WINSOCK" = 1; then
547551 AC_DEFINE(UB_ON_WINDOWS, 1, [Use win32 resources and API])
556560 if test $ac_cv_func_getaddrinfo = no; then
557561 AC_LIBOBJ([fake-rfc2553])
558562 fi
563 # check after getaddrinfo for its libraries
564 ACX_FUNC_IOCTLSOCKET
559565
560566 # see if daemon(3) exists, and if it is deprecated.
561567 AC_CHECK_FUNCS([daemon])
566572 fi
567573
568574 AC_SEARCH_LIBS([setusercontext], [util])
569 AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev setresuid setreuid setresgid setregid glob initgroups strftime localtime_r setusercontext _beginthreadex])
575 AC_CHECK_FUNCS([tzset sigprocmask fcntl getpwnam getrlimit setsid sbrk chroot kill sleep usleep random srandom recvmsg sendmsg writev glob initgroups strftime localtime_r setusercontext _beginthreadex])
576 AC_CHECK_FUNCS([setresuid],,[AC_CHECK_FUNCS([setreuid])])
577 AC_CHECK_FUNCS([setresgid],,[AC_CHECK_FUNCS([setregid])])
570578
571579 # check if setreuid en setregid fail, on MacOSX10.4(darwin8).
572580 if echo $build_os | grep darwin8 > /dev/null; then
573581 AC_DEFINE(DARWIN_BROKEN_SETREUID, 1, [Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work])
574582 fi
575 ACX_CHECK_NONBLOCKING_BROKEN
576 ACX_MKDIR_ONE_ARG
577 ACX_FUNC_IOCTLSOCKET
578583 AC_REPLACE_FUNCS(inet_aton)
579584 AC_REPLACE_FUNCS(inet_pton)
580585 AC_REPLACE_FUNCS(inet_ntop)
697702
698703 #ifdef HAVE_WS2TCPIP_H
699704 #include <ws2tcpip.h>
700 #endif
701
702 #ifdef HAVE_GETOPT_H
703 #include <getopt.h>
704 #endif
705
706 #ifdef HAVE_OPENSSL_ERR_H
707 #include <openssl/err.h>
708 #endif
709
710 #ifdef HAVE_OPENSSL_RAND_H
711 #include <openssl/rand.h>
712 #endif
713
714 #ifdef HAVE_OPENSSL_CONF_H
715 #include <openssl/conf.h>
716 #endif
717
718 #ifdef HAVE_OPENSSL_ENGINE_H
719 #include <openssl/engine.h>
720705 #endif
721706 ]
722707
765750 struct sockaddr_storage;
766751 #include "compat/fake-rfc2553.h"
767752 #endif
768
769 #include "ldns/ldns.h"
770753
771754 #ifdef UNBOUND_ALLOC_STATS
772755 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
00 Summary: Validating, recursive, and caching DNS resolver
11 Name: unbound
2 Version: 1.0.1
2 Version: 1.4.4
33 Release: 1%{?dist}
44 License: BSD
55 Url: http://www.nlnetlabs.nl/unbound/
3939 * to text format.
4040 */
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "daemon/cachedump.h"
4344 #include "daemon/remote.h"
4445 #include "daemon/worker.h"
3939 */
4040
4141 #include "config.h"
42 #ifdef HAVE_OPENSSL_ERR_H
43 #include <openssl/err.h>
44 #endif
45
46 #ifdef HAVE_OPENSSL_RAND_H
47 #include <openssl/rand.h>
48 #endif
49
50 #ifdef HAVE_OPENSSL_CONF_H
51 #include <openssl/conf.h>
52 #endif
53
54 #ifdef HAVE_OPENSSL_ENGINE_H
55 #include <openssl/engine.h>
56 #endif
57 #include "ldns/ldns.h"
4258 #include "daemon/daemon.h"
4359 #include "daemon/worker.h"
4460 #include "daemon/remote.h"
275291 /* Knuth shuffle */
276292 n = avail;
277293 while(--n > 0) {
278 k = ub_random(daemon->rand) % (n+1); /* 0<= k<= n */
294 k = ub_random_max(daemon->rand, n+1); /* 0<= k<= n */
279295 temp = shufport[k];
280296 shufport[k] = shufport[n];
281297 shufport[n] = temp;
4242 * Both the server and the client(control tool) have their own keys.
4343 */
4444 #include "config.h"
45 #ifdef HAVE_OPENSSL_ERR_H
46 #include <openssl/err.h>
47 #endif
48 #include <ctype.h>
49 #include "ldns/ldns.h"
4550 #include "daemon/remote.h"
4651 #include "daemon/worker.h"
4752 #include "daemon/daemon.h"
11101115 size_t len;
11111116 /** labels */
11121117 int labs;
1118 /** now */
1119 uint32_t now;
11131120 /** time to invalidate to */
11141121 uint32_t expired;
11151122 /** number of rrsets removed */
11301137 if(dname_subdomain_c(k->rk.dname, inf->name)) {
11311138 struct packed_rrset_data* d =
11321139 (struct packed_rrset_data*)e->data;
1133 d->ttl = inf->expired;
1134 inf->num_rrsets++;
1140 if(d->ttl >= inf->now) {
1141 d->ttl = inf->expired;
1142 inf->num_rrsets++;
1143 }
11351144 }
11361145 }
11371146
11441153 struct msgreply_entry* k = (struct msgreply_entry*)e->key;
11451154 if(dname_subdomain_c(k->key.qname, inf->name)) {
11461155 struct reply_info* d = (struct reply_info*)e->data;
1147 d->ttl = inf->expired;
1148 inf->num_msgs++;
1156 if(d->ttl >= inf->now) {
1157 d->ttl = inf->expired;
1158 inf->num_msgs++;
1159 }
11491160 }
11501161 }
11511162
11581169 struct key_entry_key* k = (struct key_entry_key*)e->key;
11591170 if(dname_subdomain_c(k->name, inf->name)) {
11601171 struct key_entry_data* d = (struct key_entry_data*)e->data;
1161 d->ttl = inf->expired;
1162 inf->num_keys++;
1172 if(d->ttl >= inf->now) {
1173 d->ttl = inf->expired;
1174 inf->num_keys++;
1175 }
11631176 }
11641177 }
11651178
11791192 inf.name = nm;
11801193 inf.len = nmlen;
11811194 inf.labs = nmlabs;
1195 inf.now = *worker->env.now;
11821196 inf.expired = *worker->env.now;
11831197 inf.expired -= 3; /* handle 3 seconds skew between threads */
11841198 inf.num_rrsets = 0;
4444
4545 #ifndef DAEMON_REMOTE_H
4646 #define DAEMON_REMOTE_H
47 #ifdef HAVE_OPENSSL_SSL_H
48 #include "openssl/ssl.h"
49 #endif
4750 struct config_file;
4851 struct listen_list;
4952 struct listen_port;
3939 * numbers. These 'statistics' may be of interest to the operator.
4040 */
4141 #include "config.h"
42 #include "ldns/wire2host.h"
4243 #include "daemon/stats.h"
4344 #include "daemon/worker.h"
4445 #include "daemon/daemon.h"
4242 #ifndef DAEMON_STATS_H
4343 #define DAEMON_STATS_H
4444 #include "util/timehist.h"
45 #include "ldns/buffer.h"
4546 struct worker;
4647 struct config_file;
4748 struct comm_point;
4040 */
4141
4242 #include "config.h"
43 #ifdef HAVE_GETOPT_H
44 #include <getopt.h>
45 #endif
4346 #include "util/log.h"
4447 #include "daemon/daemon.h"
4548 #include "daemon/remote.h"
3939 * pending requests.
4040 */
4141 #include "config.h"
42 #include "ldns/wire2host.h"
4243 #include "util/log.h"
4344 #include "util/net_help.h"
4445 #include "util/random.h"
12461247
12471248 struct outbound_entry*
12481249 worker_send_query(uint8_t* qname, size_t qnamelen, uint16_t qtype,
1249 uint16_t qclass, uint16_t flags, int dnssec,
1250 uint16_t qclass, uint16_t flags, int dnssec, int want_dnssec,
12501251 struct sockaddr_storage* addr, socklen_t addrlen,
12511252 struct module_qstate* q)
12521253 {
12571258 return NULL;
12581259 e->qstate = q;
12591260 e->qsent = outnet_serviced_query(worker->back, qname,
1260 qnamelen, qtype, qclass, flags, dnssec, addr, addrlen,
1261 worker_handle_service_reply, e, worker->back->udp_buff,
1262 &outbound_entry_compare);
1261 qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
1262 addr, addrlen, worker_handle_service_reply, e,
1263 worker->back->udp_buff, &outbound_entry_compare);
12631264 if(!e->qsent) {
12641265 return NULL;
12651266 }
12941295 struct outbound_entry* libworker_send_query(uint8_t* ATTR_UNUSED(qname),
12951296 size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
12961297 uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
1297 int ATTR_UNUSED(dnssec), struct sockaddr_storage* ATTR_UNUSED(addr),
1298 int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
1299 struct sockaddr_storage* ATTR_UNUSED(addr),
12981300 socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
12991301 {
13001302 log_assert(0);
188188 * @param qclass: query class. (host order)
189189 * @param flags: host order flags word, with opcode and CD bit.
190190 * @param dnssec: if set, EDNS record will have DO bit set.
191 * @param want_dnssec: signatures needed.
191192 * @param addr: where to.
192193 * @param addrlen: length of addr.
193194 * @param q: wich query state to reactivate upon return.
196197 */
197198 struct outbound_entry* worker_send_query(uint8_t* qname, size_t qnamelen,
198199 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
199 struct sockaddr_storage* addr, socklen_t addrlen,
200 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
200201 struct module_qstate* q);
201202
202203 /**
0 22 April 2010: Wouter
1 - tag 1.4.4.
2
3 16 April 2010: Wouter
4 - more portability defines for CMSG_SPACE, CMSG_ALIGN, CMSG_LEN.
5 - tag 1.4.4rc1.
6
7 15 April 2010: Wouter
8 - ECC-GOST algorithm number 12 that is assigned by IANA. New test
9 example key and signatures for GOST. GOST requires openssl-1.0.0.
10 GOST is still disabled by default.
11
12 9 April 2010: Wouter
13 - Fix bug#305: pkt_dname_tolower could read beyond end of buffer or
14 get into an endless loop, if 0x20 was enabled, and buffers are small
15 or particular broken packets are received.
16 - Fix chain of trust with CNAME at an intermediate step, for the DS
17 processing proof.
18
19 8 April 2010: Wouter
20 - Fix validation of queries with wildcard names (*.example).
21
22 6 April 2010: Wouter
23 - Fix EDNS probe for .de DNSSEC testbed failure, where the infra
24 cache timeout coincided with a server update, the current EDNS
25 backoff is less sensitive, and does not cache the backoff unless
26 the backoff actually works and the domain is not expecting DNSSEC.
27 - GOST support with correct algorithm numbers.
28
29 1 April 2010: Wouter
30 - iana portlist updated.
31
32 24 March 2010: Wouter
33 - unbound control flushed items are not counted when flushed again.
34
35 23 March 2010: Wouter
36 - iana portlist updated.
37
38 22 March 2010: Wouter
39 - unbound-host disables use-syslog from config file so that the
40 config file for the main server can be used more easily.
41 - fix bug#301: unbound-checkconf could not parse interface
42 '0.0.0.0@5353', even though unbound itself worked fine.
43
44 19 March 2010: Wouter
45 - fix fwd_ancil test to pass if the socket options are not supported.
46
47 18 March 2010: Wouter
48 - Fixed random numbers for port, interface and server selection.
49 Removed very small bias.
50 - Refer to the listing in unbound-control man page in the extended
51 statistics entry in the unbound.conf man page.
52
53 16 March 2010: Wouter
54 - Fix interface-automatic for OpenBSD: msg.controllen was too small,
55 also assertions on ancillary data buffer.
56 - check for IP_SENDSRCADDR for interface-automatic or IP_PKTINFO.
57 - for NSEC3 check if signatures are cached.
58
59 15 March 2010: Wouter
60 - unit test for util/regional.c.
61
62 12 March 2010: Wouter
63 - Reordered configure checks so fork and -lnsl -lsocket checks are
64 earlier, and thus later checks benefit from and do not hinder them.
65 - iana portlist updated.
66 - ldns tarball updated.
67 - Fix python use when multithreaded.
68 - Fix solaris python compile.
69 - Include less in config.h and include per code file for ldns, ssl.
70
071 11 March 2010: Wouter
172 - another memory allocation option: --enable-alloc-nonregional.
273 exposes the regional allocations to other memory purifiers.
475 - Fix for MacPorts ldns without ssl default, unbound checks if ldns
576 has dnssec functionality and uses the builtin if not.
677 - Fix daemonize on Solaris 10, it did not detach from terminal.
78 - tag 1.4.3 created.
79 - trunk is 1.4.4 in development.
80 - spelling fix in validation error involving cnames.
781
882 10 March 2010: Wouter
983 - --enable-alloc-lite works with test set.
0 README for Unbound 1.4.3
0 README for Unbound 1.4.4
11 Copyright 2007 NLnet Labs
22 http://unbound.net
33
55
66 You need to have the following programs installed and in your PATH.
77 * dig - from the bind-tools package. Used to send DNS queries.
8 * wdiff - used for word-by-word comparisons.
89 * splint (optional) - for lint test
910 * doxygen (optional) - for doc completeness test
1011 * ldns-testns (optional) - from ldns examples. Used as DNS auth server.
6868 document high scalable, high available unbound setup onepager.
6969 - prefetch DNSKEY when DS in delegation seen (nonCD, underTA).
7070 - use libevent if available on system by default(?), default outgoing 256to1024
71
72 [1] BIND-like query logging to see who's looking up what and when
73 [2] more logging about stuff like SERVFAIL and REFUSED responses
74 [3] a Makefile that works without gnumake
75
6161 local_data_add www.example.com. IN A 192.0.2.2
6262 if no local_zone exists for it; a transparent zone with the same
6363 name as the data is created.
64
65
64 Other commands in the unbound-control manual page.
343343 # val-bogus-ttl: 60
344344
345345 # The signature inception and expiration dates are allowed to be off
346 # by 10% of the lifetime of the signature from our local clock.
346 # by 10% of the signature lifetime (expir-incep) from our local clock.
347347 # This leeway is capped with a minimum and a maximum. In seconds.
348348 # val-sig-skew-min: 3600
349349 # val-sig-skew-max: 86400
0 .TH "libunbound" "3" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "libunbound" "3" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" libunbound.3 -- unbound library functions manual
33 .\"
4141 .B ub_ctx_zone_remove,
4242 .B ub_ctx_data_add,
4343 .B ub_ctx_data_remove
44 \- Unbound DNS validating resolver 1.4.3 functions.
44 \- Unbound DNS validating resolver 1.4.4 functions.
4545 .SH "SYNOPSIS"
4646 .LP
4747 .B #include <unbound.h>
0 .TH "unbound-checkconf" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "unbound-checkconf" "8" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" unbound-checkconf.8 -- unbound configuration checker manual
33 .\"
0 .TH "unbound-control" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "unbound-control" "8" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" unbound-control.8 -- unbound remote control manual
33 .\"
0 .TH "unbound\-host" "1" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "unbound\-host" "1" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" unbound-host.1 -- unbound DNS lookup utility
33 .\"
0 .TH "unbound" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "unbound" "8" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" unbound.8 -- unbound manual
33 .\"
99 .SH "NAME"
1010 .LP
1111 .B unbound
12 \- Unbound DNS validating resolver 1.4.3.
12 \- Unbound DNS validating resolver 1.4.4.
1313 .SH "SYNOPSIS"
1414 .LP
1515 .B unbound
0 .TH "unbound.conf" "5" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
0 .TH "unbound.conf" "5" "Apr 22, 2010" "NLnet Labs" "unbound 1.4.4"
11 .\"
22 .\" unbound.conf.5 -- unbound.conf manual
33 .\"
9999 .TP
100100 .B extended\-statistics: \fI<yes or no>
101101 If enabled, extended statistics are printed from \fIunbound\-control\fR(8).
102 Default is off, because keeping track of more statistics takes time.
102 Default is off, because keeping track of more statistics takes time. The
103 counters are listed in \fIunbound\-control\fR(8).
103104 .TP
104105 .B num\-threads: \fI<number>
105106 The number of threads to create to serve clients. Use 1 for no threading.
580581 .TP
581582 .B val\-sig\-skew\-min: \fI<seconds>
582583 Minimum number of seconds of clock skew to apply to validated signatures.
583 A value of 10% of the signature lifetime is used, capped by this setting.
584 Default is 3600 (1 hour) which allows for daylight savings differences.
585 Lower this value for more strict checking of short lived signatures.
584 A value of 10% of the signature lifetime (expiration \- inception) is
585 used, capped by this setting. Default is 3600 (1 hour) which allows for
586 daylight savings differences. Lower this value for more strict checking
587 of short lived signatures.
586588 .TP
587589 .B val\-sig\-skew\-max: \fI<seconds>
588590 Maximum number of seconds of clock skew to apply to validated signatures.
589 A value of 10% of the signature lifetime is used, capped by this setting.
590 Default is 86400 (24 hours) which allows for timezone setting problems in
591 stable domains. Setting both min and max very low disables the clock skew
592 allowances. Setting both min and max very high makes the validator check
593 the signature timestamps less strictly.
591 A value of 10% of the signature lifetime (expiration \- inception)
592 is used, capped by this setting. Default is 86400 (24 hours) which
593 allows for timezone setting problems in stable domains. Setting both
594 min and max very low disables the clock skew allowances. Setting both
595 min and max very high makes the validator check the signature timestamps
596 less strictly.
594597 .TP
595598 .B val\-bogus\-ttl: \fI<number>
596599 The time to live for bogus data. This is data that has failed validation;
3939 * Keep track of forward zones and config settings.
4040 */
4141 #include "config.h"
42 #include "ldns/rdata.h"
43 #include "ldns/dname.h"
44 #include "ldns/rr.h"
4245 #include "iterator/iter_fwd.h"
4346 #include "iterator/iter_delegpt.h"
4447 #include "util/regional.h"
3939 * Keep track of stub and root hints, and read those from config.
4040 */
4141 #include "config.h"
42 #include "ldns/dname.h"
43 #include "ldns/rr.h"
4244 #include "iterator/iter_hints.h"
4345 #include "iterator/iter_delegpt.h"
4446 #include "util/regional.h"
4040 */
4141
4242 #include "config.h"
43 #include "ldns/dname.h"
4344 #include "iterator/iter_priv.h"
4445 #include "util/regional.h"
4546 #include "util/log.h"
4242 #ifndef ITERATOR_ITER_PRIV_H
4343 #define ITERATOR_ITER_PRIV_H
4444 #include "util/rbtree.h"
45 #include "ldns/buffer.h"
4546 struct iter_env;
4647 struct config_file;
4748 struct regional;
3939 * one of the response types.
4040 */
4141 #include "config.h"
42 #include "ldns/packet.h"
4243 #include "iterator/iter_resptype.h"
4344 #include "iterator/iter_delegpt.h"
4445 #include "services/cache/dns.h"
4141
4242 #ifndef ITERATOR_ITER_SCRUB_H
4343 #define ITERATOR_ITER_SCRUB_H
44 #include "ldns/buffer.h"
4445 struct msg_parse;
4546 struct query_info;
4647 struct regional;
349349
350350 /* randomly select a target from the list */
351351 log_assert(num > 1);
352 /* we do not need secure random numbers here, but
353 * we do need it to be threadsafe, so we use this */
354 sel = ub_random(env->rnd) % num;
352 /* grab secure random number, to pick unexpected server.
353 * also we need it to be threadsafe. */
354 sel = ub_random_max(env->rnd, num);
355355 a = dp->result_list;
356356 prev = NULL;
357357 while(sel > 0 && a) {
417417 return 1;
418418 /* we do not need secure random numbers here, but
419419 * we do need it to be threadsafe, so we use this */
420 sel = ub_random(rnd) % m;
420 sel = ub_random_max(rnd, m);
421421 return (sel < n);
422422 }
423423
4242 #ifndef ITERATOR_ITER_UTILS_H
4343 #define ITERATOR_ITER_UTILS_H
4444 #include "iterator/iter_resptype.h"
45 #include "ldns/buffer.h"
4546 struct iter_env;
4647 struct iter_hints;
4748 struct iter_forwards;
4040 */
4141
4242 #include "config.h"
43 #include "ldns/ldns.h"
4344 #include "iterator/iterator.h"
4445 #include "iterator/iter_utils.h"
4546 #include "iterator/iter_hints.h"
15191520 iq->qchase.qname, iq->qchase.qname_len,
15201521 iq->qchase.qtype, iq->qchase.qclass,
15211522 iq->chase_flags | (iq->chase_to_rd?BIT_RD:0), EDNS_DO|BIT_CD,
1522 &target->addr, target->addrlen, qstate);
1523 iq->dnssec_expected, &target->addr, target->addrlen, qstate);
15231524 if(!outq) {
15241525 log_addr(VERB_DETAIL, "error sending query to auth server",
15251526 &target->addr, target->addrlen);
Binary diff not shown
4343 /* include the public api first, it should be able to stand alone */
4444 #include "libunbound/unbound.h"
4545 #include "config.h"
46 #include <ctype.h>
4647 #include "libunbound/context.h"
4748 #include "libunbound/libworker.h"
4849 #include "util/locks.h"
4141 * returns from the procedure when done.
4242 */
4343 #include "config.h"
44 #include <ldns/dname.h>
45 #include <ldns/wire2host.h>
4446 #include "libunbound/libworker.h"
4547 #include "libunbound/context.h"
4648 #include "libunbound/unbound.h"
693695
694696 struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
695697 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
696 struct sockaddr_storage* addr, socklen_t addrlen,
698 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
697699 struct module_qstate* q)
698700 {
699701 struct libworker* w = (struct libworker*)q->env->worker;
703705 return NULL;
704706 e->qstate = q;
705707 e->qsent = outnet_serviced_query(w->back, qname,
706 qnamelen, qtype, qclass, flags, dnssec, addr, addrlen,
707 libworker_handle_service_reply, e, w->back->udp_buff,
708 &outbound_entry_compare);
708 qnamelen, qtype, qclass, flags, dnssec, want_dnssec,
709 addr, addrlen, libworker_handle_service_reply, e,
710 w->back->udp_buff, &outbound_entry_compare);
709711 if(!e->qsent) {
710712 return NULL;
711713 }
832834 struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
833835 size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
834836 uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
835 int ATTR_UNUSED(dnssec), struct sockaddr_storage* ATTR_UNUSED(addr),
837 int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
838 struct sockaddr_storage* ATTR_UNUSED(addr),
836839 socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
837840 {
838841 log_assert(0);
128128 * @param qclass: query class. (host order)
129129 * @param flags: host order flags word, with opcode and CD bit.
130130 * @param dnssec: if set, EDNS record will have DO bit set.
131 * @param want_dnssec: signatures needed.
131132 * @param addr: where to.
132133 * @param addrlen: length of addr.
133134 * @param q: wich query state to reactivate upon return.
136137 */
137138 struct outbound_entry* libworker_send_query(uint8_t* qname, size_t qnamelen,
138139 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
139 struct sockaddr_storage* addr, socklen_t addrlen,
140 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen,
140141 struct module_qstate* q);
141142
142143 /** process incoming replies from the network */
4343 #endif
4444
4545 #include "config.h"
46 #include "ldns/ldns.h"
4647
4748 #undef _POSIX_C_SOURCE
4849 #undef _XOPEN_SOURCE
5556
5657 #ifdef S_SPLINT_S
5758 typedef struct PyObject PyObject;
59 typedef struct PyThreadState PyThreadState;
60 typedef void* PyGILState_STATE;
5861 #endif
5962
6063 /**
6568 /** Python script filename. */
6669 const char* fname;
6770
71 /** Python main thread */
72 PyThreadState* mainthr;
6873 /** Python module. */
6974 PyObject* module;
7075
106111 /* Initialize module */
107112 FILE* script_py = NULL;
108113 PyObject* py_cfg, *res;
114 PyGILState_STATE gil;
109115 struct pythonmod_env* pe = (struct pythonmod_env*)calloc(1, sizeof(struct pythonmod_env));
110116 if (!pe)
111117 {
129135 Py_NoSiteFlag = 1;
130136 Py_Initialize();
131137 PyEval_InitThreads();
132 PyEval_ReleaseLock();
133138 SWIG_init();
134 }
135
136 PyEval_AcquireLock();
139 pe->mainthr = PyEval_SaveThread();
140 }
141
142 gil = PyGILState_Ensure();
137143
138144 /* Initialize Python */
139145 PyRun_SimpleString("import sys \n");
149155 if (PyRun_SimpleString("from unboundmodule import *\n") < 0)
150156 {
151157 log_err("pythonmod: cannot initialize core module: unboundmodule.py");
152 PyEval_ReleaseLock();
158 PyGILState_Release(gil);
153159 return 0;
154160 }
155161
157163 if ((script_py = fopen(pe->fname, "r")) == NULL)
158164 {
159165 log_err("pythonmod: can't open file %s for reading", pe->fname);
160 PyEval_ReleaseLock();
166 PyGILState_Release(gil);
161167 return 0;
162168 }
163169
173179 if (PyRun_SimpleFile(script_py, pe->fname) < 0)
174180 {
175181 log_err("pythonmod: can't parse Python script %s", pe->fname);
176 PyEval_ReleaseLock();
182 PyGILState_Release(gil);
177183 return 0;
178184 }
179185
182188 if ((pe->func_init = PyDict_GetItemString(pe->dict, "init")) == NULL)
183189 {
184190 log_err("pythonmod: function init is missing in %s", pe->fname);
185 PyEval_ReleaseLock();
191 PyGILState_Release(gil);
186192 return 0;
187193 }
188194 if ((pe->func_deinit = PyDict_GetItemString(pe->dict, "deinit")) == NULL)
189195 {
190196 log_err("pythonmod: function deinit is missing in %s", pe->fname);
191 PyEval_ReleaseLock();
197 PyGILState_Release(gil);
192198 return 0;
193199 }
194200 if ((pe->func_operate = PyDict_GetItemString(pe->dict, "operate")) == NULL)
195201 {
196202 log_err("pythonmod: function operate is missing in %s", pe->fname);
197 PyEval_ReleaseLock();
203 PyGILState_Release(gil);
198204 return 0;
199205 }
200206 if ((pe->func_inform = PyDict_GetItemString(pe->dict, "inform_super")) == NULL)
201207 {
202208 log_err("pythonmod: function inform_super is missing in %s", pe->fname);
203 PyEval_ReleaseLock();
209 PyGILState_Release(gil);
204210 return 0;
205211 }
206212
214220
215221 Py_XDECREF(res);
216222 Py_XDECREF(py_cfg);
217 PyEval_ReleaseLock();
223 PyGILState_Release(gil);
218224
219225 return 1;
220226 }
229235 if(pe->module != NULL)
230236 {
231237 PyObject* res;
238 PyGILState_STATE gil = PyGILState_Ensure();
232239
233240 /* Deinit module */
234 PyEval_AcquireLock();
235241 res = PyObject_CallFunction(pe->func_deinit, "i", id);
236242 if (PyErr_Occurred()) {
237243 log_err("pythonmod: Exception occurred in function deinit");
241247 Py_XDECREF(res);
242248 /* Free shared data if any */
243249 Py_XDECREF(pe->data);
244
250 PyGILState_Release(gil);
251
252 PyEval_RestoreThread(pe->mainthr);
245253 Py_Finalize();
254 pe->mainthr = NULL;
246255 }
247256 pe->fname = NULL;
248257 free(pe);
256265 struct pythonmod_env* pe = (struct pythonmod_env*)qstate->env->modinfo[id];
257266 struct pythonmod_qstate* pq = (struct pythonmod_qstate*)qstate->minfo[id];
258267 PyObject* py_qstate, *py_sqstate, *res;
268 PyGILState_STATE gil = PyGILState_Ensure();
259269
260270 log_query_info(VERB_ALGO, "pythonmod: inform_super, sub is", &qstate->qinfo);
261271 log_query_info(VERB_ALGO, "super is", &super->qinfo);
263273 py_qstate = SWIG_NewPointerObj((void*) qstate, SWIGTYPE_p_module_qstate, 0);
264274 py_sqstate = SWIG_NewPointerObj((void*) super, SWIGTYPE_p_module_qstate, 0);
265275
266 PyEval_AcquireLock();
267276 res = PyObject_CallFunction(pe->func_inform, "iOOO", id, py_qstate,
268277 py_sqstate, pq->data);
269278
283292 Py_XDECREF(py_sqstate);
284293 Py_XDECREF(py_qstate);
285294
286 PyEval_ReleaseLock();
295 PyGILState_Release(gil);
287296 }
288297
289298 void pythonmod_operate(struct module_qstate* qstate, enum module_ev event,
292301 struct pythonmod_env* pe = (struct pythonmod_env*)qstate->env->modinfo[id];
293302 struct pythonmod_qstate* pq = (struct pythonmod_qstate*)qstate->minfo[id];
294303 PyObject* py_qstate, *res;
304 PyGILState_STATE gil = PyGILState_Ensure();
295305
296306 if ( pq == NULL)
297307 {
303313 Py_INCREF(pq->data);
304314 }
305315
306 /* Lock Python */
307 PyEval_AcquireLock();
308
309316 /* Call operate */
310317 py_qstate = SWIG_NewPointerObj((void*) qstate, SWIGTYPE_p_module_qstate, 0);
311318 res = PyObject_CallFunction(pe->func_operate, "iiOO", id, (int) event,
324331 Py_XDECREF(res);
325332 Py_XDECREF(py_qstate);
326333
327 /* Unlock Python */
328 PyEval_ReleaseLock();
334 PyGILState_Release(gil);
329335 }
330336
331337 void pythonmod_clear(struct module_qstate* qstate, int id)
339345 (unsigned long int)pq);
340346 if(pq != NULL)
341347 {
348 PyGILState_STATE gil = PyGILState_Ensure();
342349 Py_DECREF(pq->data);
350 PyGILState_Release(gil);
343351 /* Free qstate */
344352 free(pq);
345353 }
3838 * This file contains the infrastructure cache.
3939 */
4040 #include "config.h"
41 #include "ldns/rr.h"
4142 #include "services/cache/infra.h"
4243 #include "util/storage/slabhash.h"
4344 #include "util/storage/lookup3.h"
3838 * This file has functions to get queries from clients.
3939 */
4040 #include "config.h"
41 #ifdef HAVE_SYS_TYPES_H
42 # include <sys/types.h>
43 #endif
44 #include <sys/time.h>
4145 #include "services/listen_dnsport.h"
4246 #include "services/outside_network.h"
4347 #include "util/netevent.h"
4549 #include "util/config_file.h"
4650 #include "util/net_help.h"
4751
48 #ifdef HAVE_SYS_TYPES_H
49 # include <sys/types.h>
50 #endif
5152 #ifdef HAVE_NETDB_H
5253 #include <netdb.h>
5354 #endif
489490 static int
490491 set_recvpktinfo(int s, int family)
491492 {
492 #if defined(IPV6_RECVPKTINFO) || defined(IPV6_PKTINFO) || defined(IP_RECVDSTADDR) || defined(IP_PKTINFO)
493 #if defined(IPV6_RECVPKTINFO) || defined(IPV6_PKTINFO) || (defined(IP_RECVDSTADDR) && defined(IP_SENDSRCADDR)) || defined(IP_PKTINFO)
493494 int on = 1;
494495 #else
495496 (void)s;
516517 # endif /* defined IPV6_RECVPKTINFO */
517518
518519 } else if(family == AF_INET) {
519 # ifdef IP_RECVDSTADDR
520 # ifdef IP_PKTINFO
521 if(setsockopt(s, IPPROTO_IP, IP_PKTINFO,
522 (void*)&on, (socklen_t)sizeof(on)) < 0) {
523 log_err("setsockopt(..., IP_PKTINFO, ...) failed: %s",
524 strerror(errno));
525 return 0;
526 }
527 # elif defined(IP_RECVDSTADDR) && defined(IP_SENDSRCADDR)
520528 if(setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR,
521529 (void*)&on, (socklen_t)sizeof(on)) < 0) {
522530 log_err("setsockopt(..., IP_RECVDSTADDR, ...) failed: %s",
523531 strerror(errno));
524532 return 0;
525533 }
526 # elif defined(IP_PKTINFO)
527 if(setsockopt(s, IPPROTO_IP, IP_PKTINFO,
528 (void*)&on, (socklen_t)sizeof(on)) < 0) {
529 log_err("setsockopt(..., IP_PKTINFO, ...) failed: %s",
530 strerror(errno));
531 return 0;
532 }
533534 # else
534 log_err("no IP_RECVDSTADDR or IP_PKTINFO option, please disable "
535 log_err("no IP_SENDSRCADDR or IP_PKTINFO option, please disable "
535536 "interface-automatic in config");
536537 return 0;
537538 # endif /* IP_PKTINFO */
3838 * This file contains functions to enable local zone authority service.
3939 */
4040 #include "config.h"
41 #include "ldns/dname.h"
42 #include "ldns/host2wire.h"
4143 #include "services/localzone.h"
4244 #include "util/regional.h"
4345 #include "util/config_file.h"
4242 * send back to clients.
4343 */
4444 #include "config.h"
45 #include "ldns/wire2host.h"
4546 #include "services/mesh.h"
4647 #include "services/outbound_list.h"
4748 #include "services/cache/dns.h"
3838 * This file contains functions to help maintain a stack of modules.
3939 */
4040 #include "config.h"
41 #include <ctype.h>
4142 #include "services/modstack.h"
4243 #include "util/module.h"
4344 #include "util/fptr_wlist.h"
3939 * queries it has outstanding to authoritative servers.
4040 */
4141 #include "config.h"
42 #include <sys/time.h>
4243 #include "services/outbound_list.h"
4344 #include "services/outside_network.h"
4445
3939 * wait for the pending answer events.
4040 */
4141 #include "config.h"
42 #include <ctype.h>
43 #ifdef HAVE_SYS_TYPES_H
44 # include <sys/types.h>
45 #endif
46 #include <sys/time.h>
47 #include "ldns/wire2host.h"
4248 #include "services/outside_network.h"
4349 #include "services/listen_dnsport.h"
4450 #include "services/cache/infra.h"
5258 #include "util/random.h"
5359 #include "util/fptr_wlist.h"
5460
55 #ifdef HAVE_SYS_TYPES_H
56 # include <sys/types.h>
57 #endif
5861 #ifdef HAVE_NETDB_H
5962 #include <netdb.h>
6063 #endif
806809 log_assert(outnet->unused_fds);
807810 tries = 0;
808811 while(1) {
809 my_if = ub_random(outnet->rnd) % num_if;
812 my_if = ub_random_max(outnet->rnd, num_if);
810813 pif = &ifs[my_if];
811 my_port = ub_random(outnet->rnd) % pif->avail_total;
814 my_port = ub_random_max(outnet->rnd, pif->avail_total);
812815 if(my_port < pif->inuse) {
813816 /* port already open */
814817 pend->pc = pif->out[my_port];
10741077 /** Create new serviced entry */
10751078 static struct serviced_query*
10761079 serviced_create(struct outside_network* outnet, ldns_buffer* buff, int dnssec,
1077 struct sockaddr_storage* addr, socklen_t addrlen)
1080 int want_dnssec, struct sockaddr_storage* addr, socklen_t addrlen)
10781081 {
10791082 struct serviced_query* sq = (struct serviced_query*)malloc(sizeof(*sq));
10801083 rbnode_t* ins;
10881091 }
10891092 sq->qbuflen = ldns_buffer_limit(buff);
10901093 sq->dnssec = dnssec;
1094 sq->want_dnssec = want_dnssec;
10911095 memcpy(&sq->addr, addr, addrlen);
10921096 sq->addrlen = addrlen;
10931097 sq->outnet = outnet;
11291133 /* clear up the pending query */
11301134 if(sq->status == serviced_query_UDP_EDNS ||
11311135 sq->status == serviced_query_UDP ||
1132 sq->status == serviced_query_PROBE_EDNS) {
1136 sq->status == serviced_query_PROBE_EDNS ||
1137 sq->status == serviced_query_UDP_EDNS_fallback) {
11331138 struct pending* p = (struct pending*)sq->pending;
11341139 if(p->pc)
11351140 portcomm_loweruse(sq->outnet, p->pc);
14061411 (LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) ==
14071412 LDNS_RCODE_FORMERR || LDNS_RCODE_WIRE(ldns_buffer_begin(
14081413 c->buffer)) == LDNS_RCODE_NOTIMPL) ) {
1409 if(!infra_edns_update(sq->outnet->infra, &sq->addr,
1414 /* attempt to fallback to nonEDNS */
1415 sq->status = serviced_query_TCP_EDNS_fallback;
1416 serviced_tcp_initiate(sq->outnet, sq, c->buffer);
1417 return 0;
1418 } else if(error==NETEVENT_NOERROR &&
1419 sq->status == serviced_query_TCP_EDNS_fallback &&
1420 (LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) ==
1421 LDNS_RCODE_NOERROR || LDNS_RCODE_WIRE(
1422 ldns_buffer_begin(c->buffer)) == LDNS_RCODE_NXDOMAIN
1423 || LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer))
1424 == LDNS_RCODE_YXDOMAIN)) {
1425 /* the fallback produced a result that looks promising, note
1426 * that this server should be approached without EDNS */
1427 /* only store noEDNS in cache if domain is noDNSSEC */
1428 if(!sq->want_dnssec)
1429 if(!infra_edns_update(sq->outnet->infra, &sq->addr,
14101430 sq->addrlen, -1, *sq->outnet->now_secs))
14111431 log_err("Out of memory caching no edns for host");
14121432 sq->status = serviced_query_TCP;
1413 serviced_tcp_initiate(sq->outnet, sq, c->buffer);
1414 return 0;
14151433 }
14161434 /* insert address into reply info */
14171435 if(!rep) {
15011519 serviced_callbacks(sq, NETEVENT_TIMEOUT, c, rep);
15021520 return 0;
15031521 }
1504 }
1505 if(error == NETEVENT_NOERROR && sq->status == serviced_query_UDP_EDNS
1522 } else if(error != NETEVENT_NOERROR) {
1523 /* udp returns error (due to no ID or interface available) */
1524 serviced_callbacks(sq, error, c, rep);
1525 return 0;
1526 }
1527 if(sq->status == serviced_query_UDP_EDNS
15061528 && (LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer))
15071529 == LDNS_RCODE_FORMERR || LDNS_RCODE_WIRE(
15081530 ldns_buffer_begin(c->buffer)) == LDNS_RCODE_NOTIMPL)) {
1509 /* note no EDNS, fallback without EDNS */
1510 if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
1511 -1, (uint32_t)now.tv_sec)) {
1512 log_err("Out of memory caching no edns for host");
1513 }
1514 sq->status = serviced_query_UDP;
1531 /* try to get an answer by falling back without EDNS */
1532 sq->status = serviced_query_UDP_EDNS_fallback;
15151533 sq->retry = 0;
15161534 if(!serviced_udp_send(sq, c->buffer)) {
15171535 serviced_callbacks(sq, NETEVENT_CLOSED, c, rep);
15181536 }
15191537 return 0;
1520 }
1521 if(LDNS_TC_WIRE(ldns_buffer_begin(c->buffer)) ||
1522 (error != NETEVENT_NOERROR && fallback_tcp) ) {
1523 /* fallback to TCP */
1524 /* this discards partial UDP contents */
1525 if(sq->status == serviced_query_UDP_EDNS)
1526 sq->status = serviced_query_TCP_EDNS;
1527 else sq->status = serviced_query_TCP;
1528 serviced_tcp_initiate(outnet, sq, c->buffer);
1529 return 0;
1530 }
1531 /* yay! an answer */
1532 if(sq->status == serviced_query_PROBE_EDNS) {
1538 } else if(sq->status == serviced_query_PROBE_EDNS) {
15331539 /* probe without EDNS succeeds, so we conclude that this
15341540 * host likely has EDNS packets dropped */
15351541 log_addr(VERB_DETAIL, "timeouts, concluded that connection to "
15361542 "host drops EDNS packets", &sq->addr, sq->addrlen);
1537 if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
1543 /* only store noEDNS in cache if domain is noDNSSEC */
1544 if(!sq->want_dnssec)
1545 if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
15381546 -1, (uint32_t)now.tv_sec)) {
15391547 log_err("Out of memory caching no edns for host");
1540 }
1548 }
15411549 sq->status = serviced_query_UDP;
15421550 } else if(sq->status == serviced_query_UDP_EDNS &&
15431551 !sq->edns_lame_known) {
15471555 log_err("Out of memory caching edns works");
15481556 }
15491557 sq->edns_lame_known = 1;
1558 } else if(sq->status == serviced_query_UDP_EDNS_fallback &&
1559 !sq->edns_lame_known && (LDNS_RCODE_WIRE(
1560 ldns_buffer_begin(c->buffer)) == LDNS_RCODE_NOERROR ||
1561 LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) ==
1562 LDNS_RCODE_NXDOMAIN || LDNS_RCODE_WIRE(ldns_buffer_begin(
1563 c->buffer)) == LDNS_RCODE_YXDOMAIN)) {
1564 /* the fallback produced a result that looks promising, note
1565 * that this server should be approached without EDNS */
1566 /* only store noEDNS in cache if domain is noDNSSEC */
1567 if(!sq->want_dnssec)
1568 if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen,
1569 -1, (uint32_t)now.tv_sec)) {
1570 log_err("Out of memory caching no edns for host");
1571 }
1572 sq->status = serviced_query_UDP;
15501573 }
15511574 if(now.tv_sec > sq->last_sent_time.tv_sec ||
15521575 (now.tv_sec == sq->last_sent_time.tv_sec &&
15601583 roundtime, sq->last_rtt, (uint32_t)now.tv_sec))
15611584 log_err("out of memory noting rtt.");
15621585 }
1586 /* perform TC flag check and TCP fallback after updating our
1587 * cache entries for EDNS status and RTT times */
1588 if(LDNS_TC_WIRE(ldns_buffer_begin(c->buffer)) || fallback_tcp) {
1589 /* fallback to TCP */
1590 /* this discards partial UDP contents */
1591 if(sq->status == serviced_query_UDP_EDNS ||
1592 sq->status == serviced_query_UDP_EDNS_fallback)
1593 /* if we have unfinished EDNS_fallback, start again */
1594 sq->status = serviced_query_TCP_EDNS;
1595 else sq->status = serviced_query_TCP;
1596 serviced_tcp_initiate(outnet, sq, c->buffer);
1597 return 0;
1598 }
1599 /* yay! an answer */
15631600 serviced_callbacks(sq, error, c, rep);
15641601 return 0;
15651602 }
15801617 struct serviced_query*
15811618 outnet_serviced_query(struct outside_network* outnet,
15821619 uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
1583 uint16_t flags, int dnssec, struct sockaddr_storage* addr,
1584 socklen_t addrlen, comm_point_callback_t* callback,
1585 void* callback_arg, ldns_buffer* buff,
1586 int (*arg_compare)(void*,void*))
1620 uint16_t flags, int dnssec, int want_dnssec,
1621 struct sockaddr_storage* addr, socklen_t addrlen,
1622 comm_point_callback_t* callback, void* callback_arg,
1623 ldns_buffer* buff, int (*arg_compare)(void*,void*))
15871624 {
15881625 struct serviced_query* sq;
15891626 struct service_callback* cb;
15991636 return NULL;
16001637 if(!sq) {
16011638 /* make new serviced query entry */
1602 sq = serviced_create(outnet, buff, dnssec, addr, addrlen);
1639 sq = serviced_create(outnet, buff, dnssec, want_dnssec,
1640 addr, addrlen);
16031641 if(!sq) {
16041642 free(cb);
16051643 return NULL;
17511789 s += sizeof(*sb);
17521790 if(sq->status == serviced_query_UDP_EDNS ||
17531791 sq->status == serviced_query_UDP ||
1754 sq->status == serviced_query_PROBE_EDNS) {
1792 sq->status == serviced_query_PROBE_EDNS ||
1793 sq->status == serviced_query_UDP_EDNS_fallback) {
17551794 s += sizeof(struct pending);
17561795 s += comm_timer_get_mem(NULL);
17571796 } else {
290290 size_t qbuflen;
291291 /** If an EDNS section is included, the DO/CD bit will be turned on. */
292292 int dnssec;
293 /** We want signatures, or else the answer is likely useless */
294 int want_dnssec;
293295 /** where to send it */
294296 struct sockaddr_storage addr;
295297 /** length of addr field in use. */
307309 /** TCP without EDNS sent */
308310 serviced_query_TCP,
309311 /** probe to test EDNS lameness (EDNS is dropped) */
310 serviced_query_PROBE_EDNS
312 serviced_query_PROBE_EDNS,
313 /** probe to test noEDNS0 (EDNS gives FORMERRorNOTIMP) */
314 serviced_query_UDP_EDNS_fallback,
315 /** probe to test TCP noEDNS0 (EDNS gives FORMERRorNOTIMP) */
316 serviced_query_TCP_EDNS_fallback
311317 }
312318 /** variable with current status */
313319 status;
426432 * @param dnssec: if set, DO bit is set in EDNS queries.
427433 * If the value includes BIT_CD, CD bit is set when in EDNS queries.
428434 * If the value includes BIT_DO, DO bit is set when in EDNS queries.
435 * @param want_dnssec: signatures are needed, without EDNS the answer is
436 * likely to be useless.
429437 * @param callback: callback function.
430438 * @param callback_arg: user argument to callback function.
431439 * @param addr: to which server to send the query.
438446 */
439447 struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
440448 uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
441 uint16_t flags, int dnssec, struct sockaddr_storage* addr,
442 socklen_t addrlen, comm_point_callback_t* callback,
443 void* callback_arg, ldns_buffer* buff,
444 int (*arg_compare)(void*,void*));
449 uint16_t flags, int dnssec, int want_dnssec,
450 struct sockaddr_storage* addr, socklen_t addrlen,
451 comm_point_callback_t* callback, void* callback_arg,
452 ldns_buffer* buff, int (*arg_compare)(void*,void*));
445453
446454 /**
447455 * Remove service query callback.
5151 #include "iterator/iter_fwd.h"
5252 #include "validator/validator.h"
5353 #include "services/localzone.h"
54 #ifdef HAVE_GETOPT_H
55 #include <getopt.h>
56 #endif
5457 #ifdef HAVE_PWD_H
5558 #include <pwd.h>
5659 #endif
153156 socklen_t alen;
154157 int i, j;
155158 for(i=0; i<cfg->num_ifs; i++) {
156 if(!ipstrtoaddr(cfg->ifs[i], UNBOUND_DNS_PORT, &a, &alen)) {
159 if(!extstrtoaddr(cfg->ifs[i], &a, &alen)) {
157160 fatal_exit("cannot parse interface specified as '%s'",
158161 cfg->ifs[i]);
159162 }
4141 */
4242
4343 #include "config.h"
44 #ifdef HAVE_GETOPT_H
45 #include <getopt.h>
46 #endif
47 #ifdef HAVE_OPENSSL_SSL_H
48 #include <openssl/ssl.h>
49 #endif
50 #ifdef HAVE_OPENSSL_ERR_H
51 #include <openssl/err.h>
52 #endif
53 #ifdef HAVE_OPENSSL_RAND_H
54 #include <openssl/rand.h>
55 #endif
4456 #include "util/log.h"
4557 #include "util/config_file.h"
4658 #include "util/locks.h"
4040 */
4141
4242 #include "config.h"
43 #ifdef HAVE_GETOPT_H
44 #include <getopt.h>
45 #endif
4346 /* remove alloc checks, not in this part of the code */
4447 #ifdef UNBOUND_ALLOC_STATS
4548 #undef malloc
493496 }
494497 if(debuglevel != 0) /* set after possible -C options */
495498 check_ub_res(ub_ctx_debuglevel(ctx, debuglevel));
499 if(ub_ctx_get_option(ctx, "use-syslog", &optarg) == 0) {
500 if(strcmp(optarg, "yes") == 0) /* disable use-syslog */
501 check_ub_res(ub_ctx_set_option(ctx,
502 "use-syslog:", "no"));
503 free(optarg);
504 }
496505 argc -= optind;
497506 argv += optind;
498507 if(argc != 1)
111111 struct outbound_entry* worker_send_query(uint8_t* ATTR_UNUSED(qname),
112112 size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
113113 uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
114 int ATTR_UNUSED(dnssec), struct sockaddr_storage* ATTR_UNUSED(addr),
114 int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
115 struct sockaddr_storage* ATTR_UNUSED(addr),
115116 socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
116117 {
117118 log_assert(0);
150151 struct outbound_entry* libworker_send_query(uint8_t* ATTR_UNUSED(qname),
151152 size_t ATTR_UNUSED(qnamelen), uint16_t ATTR_UNUSED(qtype),
152153 uint16_t ATTR_UNUSED(qclass), uint16_t ATTR_UNUSED(flags),
153 int ATTR_UNUSED(dnssec), struct sockaddr_storage* ATTR_UNUSED(addr),
154 int ATTR_UNUSED(dnssec), int ATTR_UNUSED(want_dnssec),
155 struct sockaddr_storage* ATTR_UNUSED(addr),
154156 socklen_t ATTR_UNUSED(addrlen), struct module_qstate* ATTR_UNUSED(q))
155157 {
156158 log_assert(0);
4040 */
4141
4242 #include "config.h"
43 #ifdef HAVE_GETOPT_H
44 #include <getopt.h>
45 #endif
4346 #include "libunbound/unbound.h"
4447 #include "libunbound/context.h"
4548 #include "util/locks.h"
4040 */
4141
4242 #include "config.h"
43 #ifdef HAVE_GETOPT_H
44 #include <getopt.h>
45 #endif
46 #ifdef HAVE_TIME_H
47 #include <time.h>
48 #endif
49 #include <sys/time.h>
4350 #include "util/net_help.h"
4451 #include "util/config_file.h"
4552 #include <signal.h>
987987
988988 struct serviced_query* outnet_serviced_query(struct outside_network* outnet,
989989 uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
990 uint16_t flags, int dnssec, struct sockaddr_storage* addr,
991 socklen_t addrlen, comm_point_callback_t* callback,
992 void* callback_arg, ldns_buffer* ATTR_UNUSED(buff),
993 int (*arg_compare)(void*,void*))
990 uint16_t flags, int dnssec, int ATTR_UNUSED(want_dnssec),
991 struct sockaddr_storage* addr, socklen_t addrlen,
992 comm_point_callback_t* callback, void* callback_arg,
993 ldns_buffer* ATTR_UNUSED(buff), int (*arg_compare)(void*,void*))
994994 {
995995 struct replay_runtime* runtime = (struct replay_runtime*)outnet->base;
996996 struct fake_pending* pend = (struct fake_pending*)calloc(1,
6868 */
6969
7070 #include "config.h"
71 #ifdef HAVE_GETOPT_H
72 #include <getopt.h>
73 #endif
74 #include "ldns/ldns.h"
7175 #include <signal.h>
7276 #include "libunbound/unbound.h"
7377 #ifdef HAVE_SYS_STAT_H
3939 */
4040
4141 #include "config.h"
42 #ifdef HAVE_GETOPT_H
43 #include <getopt.h>
44 #endif
45 #include "ldns/ldns.h"
4246 #include <signal.h>
4347 #include "util/log.h"
4448 #include "util/locks.h"
3939 */
4040
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "util/log.h"
4344 #include "util/data/dname.h"
4445 #include "util/data/msgparse.h"
3737 * Declarations useful for the unit tests.
3838 */
3939 #include "config.h"
40 #include <ctype.h>
4041 #include "testcode/readhex.h"
4142 #include "util/log.h"
4243
3939
4040 #ifndef TESTCODE_READHEX_H
4141 #define TESTCODE_READHEX_H
42 #include "ldns/buffer.h"
4243
4344 /**
4445 * Helper to convert hex string to packet buffer.
3939 * construct input to test the validator with.
4040 */
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "util/log.h"
4344 #include "util/config_file.h"
4445 #include "util/net_help.h"
3939 */
4040
4141 #include "config.h"
42 #ifdef HAVE_GETOPT_H
43 #include <getopt.h>
44 #endif
45 #include "ldns/ldns.h"
4246 #include <signal.h>
4347 #include "util/locks.h"
4448 #include "util/log.h"
3838 */
3939
4040 #include "config.h"
41 #include "ldns/rr.h"
4142 #include "util/log.h"
4243 #include "util/data/dname.h"
4344 #include "testcode/unitmain.h"
3838 */
3939
4040 #include "config.h"
41 #include "ldns/dname.h"
42 #include "ldns/host2wire.h"
4143 #include "util/log.h"
4244 #include "testcode/unitmain.h"
4345 #include "util/data/dname.h"
792794 , 4096) == 0);
793795 }
794796
797 /** test pkt_dname_tolower */
798 static void
799 dname_test_pdtl(ldns_buffer* loopbuf, ldns_buffer* boundbuf)
800 {
801 unit_show_func("util/data/dname.c", "pkt_dname_tolower");
802 pkt_dname_tolower(loopbuf, ldns_buffer_at(loopbuf, 12));
803 pkt_dname_tolower(boundbuf, ldns_buffer_at(boundbuf, 12));
804 }
805
806 /** setup looped dname and out-of-bounds dname ptr */
807 static void
808 dname_setup_bufs(ldns_buffer* loopbuf, ldns_buffer* boundbuf)
809 {
810 ldns_buffer_write_u16(loopbuf, 0xd54d); /* id */
811 ldns_buffer_write_u16(loopbuf, 0x12); /* flags */
812 ldns_buffer_write_u16(loopbuf, 1); /* qdcount */
813 ldns_buffer_write_u16(loopbuf, 0); /* ancount */
814 ldns_buffer_write_u16(loopbuf, 0); /* nscount */
815 ldns_buffer_write_u16(loopbuf, 0); /* arcount */
816 ldns_buffer_write_u8(loopbuf, 0xc0); /* PTR back at itself */
817 ldns_buffer_write_u8(loopbuf, 0x0c);
818 ldns_buffer_flip(loopbuf);
819
820 ldns_buffer_write_u16(boundbuf, 0xd54d); /* id */
821 ldns_buffer_write_u16(boundbuf, 0x12); /* flags */
822 ldns_buffer_write_u16(boundbuf, 1); /* qdcount */
823 ldns_buffer_write_u16(boundbuf, 0); /* ancount */
824 ldns_buffer_write_u16(boundbuf, 0); /* nscount */
825 ldns_buffer_write_u16(boundbuf, 0); /* arcount */
826 ldns_buffer_write_u8(boundbuf, 0x01); /* len=1 */
827 ldns_buffer_write_u8(boundbuf, (uint8_t)'A'); /* A. label */
828 ldns_buffer_write_u8(boundbuf, 0xc0); /* PTR out of bounds */
829 ldns_buffer_write_u8(boundbuf, 0xcc);
830 ldns_buffer_flip(boundbuf);
831 }
832
795833 void dname_test()
796834 {
835 ldns_buffer* loopbuf = ldns_buffer_new(14);
836 ldns_buffer* boundbuf = ldns_buffer_new(16);
797837 ldns_buffer* buff = ldns_buffer_new(65800);
798 ldns_buffer_flip(buff);
838 unit_assert(loopbuf && boundbuf && buff);
839 ldns_buffer_flip(buff);
840 dname_setup_bufs(loopbuf, boundbuf);
799841 dname_test_qdl(buff);
800842 dname_test_qdtl(buff);
843 dname_test_pdtl(loopbuf, boundbuf);
801844 dname_test_query_dname_compare();
802845 dname_test_count_labels();
803846 dname_test_count_size_labels();
813856 dname_test_topdomain();
814857 dname_test_valid();
815858 ldns_buffer_free(buff);
816 }
859 ldns_buffer_free(loopbuf);
860 ldns_buffer_free(boundbuf);
861 }
3939 */
4040
4141 #include "config.h"
42 #ifdef HAVE_OPENSSL_ERR_H
43 #include <openssl/err.h>
44 #endif
45
46 #ifdef HAVE_OPENSSL_RAND_H
47 #include <openssl/rand.h>
48 #endif
49
50 #ifdef HAVE_OPENSSL_CONF_H
51 #include <openssl/conf.h>
52 #endif
53
54 #ifdef HAVE_OPENSSL_ENGINE_H
55 #include <openssl/engine.h>
56 #endif
57 #include "ldns/ldns.h"
4258 #include "util/log.h"
4359 #include "testcode/unitmain.h"
4460
430446 rnd_test()
431447 {
432448 struct ub_randstate* r;
433 int num = 100, i;
434 long int a[100];
449 int num = 1000, i;
450 long int a[1000];
451 unsigned int seed = (unsigned)time(NULL);
435452 unit_show_feature("ub_random");
436 unit_assert( (r = ub_initstate((unsigned)time(NULL), NULL)) );
453 printf("ub_random seed is %u\n", seed);
454 unit_assert( (r = ub_initstate(seed, NULL)) );
437455 for(i=0; i<num; i++) {
438456 a[i] = ub_random(r);
439457 unit_assert(a[i] >= 0);
442460 unit_assert(a[i] != a[i-1] || a[i] != a[i-2] ||
443461 a[i] != a[i-3] || a[i] != a[i-4] ||
444462 a[i] != a[i-5] || a[i] != a[i-6]);
463 }
464 a[0] = ub_random_max(r, 1);
465 unit_assert(a[0] >= 0 && a[0] < 1);
466 a[0] = ub_random_max(r, 10000);
467 unit_assert(a[0] >= 0 && a[0] < 10000);
468 for(i=0; i<num; i++) {
469 a[i] = ub_random_max(r, 10);
470 unit_assert(a[i] >= 0 && a[i] < 10);
445471 }
446472 ub_randfree(r);
447473 }
488514 rtt_test();
489515 anchors_test();
490516 alloc_test();
517 regional_test();
491518 lruhash_test();
492519 slabhash_test();
493520 infra_test();
496523 printf("%d checks ok.\n", testcount);
497524 #ifdef HAVE_OPENSSL_CONFIG
498525 EVP_cleanup();
499 /*ENGINE_cleanup();*/
526 ENGINE_cleanup();
500527 CONF_modules_free();
501528 #endif
502529 CRYPTO_cleanup_all_ex_data();
6969 void verify_test();
7070 /** unit test for negative cache functions */
7171 void neg_test();
72 /** unit test for regional allocator functions */
73 void regional_test();
7274
7375 #endif /* TESTCODE_UNITMAIN_H */
3838 */
3939
4040 #include "config.h"
41 #include "ldns/ldns.h"
4142 #include "util/log.h"
4243 #include "testcode/unitmain.h"
4344 #include "util/data/msgparse.h"
0 /*
1 * testcode/unitregional.c - unit test for regional allocator.
2 *
3 * Copyright (c) 2010, NLnet Labs. All rights reserved.
4 *
5 * This software is open source.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * Redistributions of source code must retain the above copyright notice,
12 * this list of conditions and the following disclaimer.
13 *
14 * Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 *
18 * Neither the name of the NLNET LABS nor the names of its contributors may
19 * be used to endorse or promote products derived from this software without
20 * specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
35 /**
36 * \file
37 * Tests the regional special purpose allocator.
38 */
39
40 #include "config.h"
41 #include "testcode/unitmain.h"
42 #include "util/log.h"
43 #include "util/regional.h"
44
45 /** test regional corner cases, zero, one, end of structure */
46 static void
47 corner_cases(struct regional* r)
48 {
49 size_t s; /* shadow count of allocated memory */
50 void* a;
51 size_t minsize = sizeof(uint64_t);
52 size_t mysize;
53 char* str;
54 unit_assert(r);
55 /* alloc cases:
56 * 0, 1, 2.
57 * smaller than LARGE_OBJECT_SIZE.
58 * smaller but does not fit in remainder in regional.
59 * smaller but exactly fits in remainder of regional.
60 * size is remainder of regional - 8.
61 * size is remainder of regional + 8.
62 * larger than LARGE_OBJECT_SIZE.
63 */
64 s = sizeof(struct regional);
65 unit_assert((s % minsize) == 0);
66 unit_assert(r->available == r->first_size - s);
67 unit_assert(r->large_list == NULL);
68 unit_assert(r->next == NULL);
69
70 /* Note an alloc of 0 gets a pointer to current last
71 * position (where you should then use 0 bytes) */
72 a = regional_alloc(r, 0);
73 unit_assert(a);
74 s+=0;
75 unit_assert(r->available == r->first_size - s);
76
77 a = regional_alloc(r, 1);
78 unit_assert(a);
79 memset(a, 0x42, 1);
80 s+=minsize;
81 unit_assert(r->available == r->first_size - s);
82
83 a = regional_alloc(r, 2);
84 unit_assert(a);
85 memset(a, 0x42, 2);
86 s+=minsize;
87 unit_assert(r->available == r->first_size - s);
88
89 a = regional_alloc(r, 128);
90 unit_assert(a);
91 memset(a, 0x42, 128);
92 s+=128;
93 unit_assert(r->available == r->first_size - s);
94
95 unit_assert(r->large_list == NULL);
96 a = regional_alloc(r, 10240);
97 unit_assert(a);
98 unit_assert(r->large_list != NULL);
99 memset(a, 0x42, 10240);
100 /* s does not change */
101 unit_assert(r->available == r->first_size - s);
102 unit_assert(r->total_large == 10240+minsize);
103
104 /* go towards the end of the current chunk */
105 while(r->available > 1024) {
106 a = regional_alloc(r, 1024);
107 unit_assert(a);
108 memset(a, 0x42, 1024);
109 s += 1024;
110 unit_assert(r->available == r->first_size - s);
111 }
112
113 unit_assert(r->next == NULL);
114 mysize = 1280; /* does not fit in current chunk */
115 a = regional_alloc(r, mysize);
116 memset(a, 0x42, mysize);
117 unit_assert(r->next != NULL);
118 unit_assert(a);
119
120 /* go towards the end of the current chunk */
121 while(r->available > 864) {
122 a = regional_alloc(r, 864);
123 unit_assert(a);
124 memset(a, 0x42, 864);
125 s += 864;
126 }
127
128 mysize = r->available; /* exactly fits */
129 a = regional_alloc(r, mysize);
130 memset(a, 0x42, mysize);
131 unit_assert(a);
132 unit_assert(r->available == 0); /* implementation does not go ahead*/
133
134 a = regional_alloc(r, 8192); /* another large allocation */
135 unit_assert(a);
136 memset(a, 0x42, 8192);
137 unit_assert(r->available == 0);
138 unit_assert(r->total_large == 10240 + 8192 + 2*minsize);
139
140 a = regional_alloc(r, 32); /* make new chunk */
141 unit_assert(a);
142 memset(a, 0x42, 32);
143 unit_assert(r->available > 0);
144 unit_assert(r->total_large == 10240 + 8192 + 2*minsize);
145
146 /* go towards the end of the current chunk */
147 while(r->available > 1320) {
148 a = regional_alloc(r, 1320);
149 unit_assert(a);
150 memset(a, 0x42, 1320);
151 s += 1320;
152 }
153
154 mysize = r->available + 8; /* exact + 8 ; does not fit */
155 a = regional_alloc(r, mysize);
156 memset(a, 0x42, mysize);
157 unit_assert(a);
158 unit_assert(r->available > 0); /* new chunk */
159
160 /* go towards the end of the current chunk */
161 while(r->available > 1480) {
162 a = regional_alloc(r, 1480);
163 unit_assert(a);
164 memset(a, 0x42, 1480);
165 s += 1480;
166 }
167
168 mysize = r->available - 8; /* exact - 8 ; fits. */
169 a = regional_alloc(r, mysize);
170 memset(a, 0x42, mysize);
171 unit_assert(a);
172 unit_assert(r->available == 8);
173
174 /* test if really copied over */
175 str = "test12345";
176 a = regional_alloc_init(r, str, 8);
177 unit_assert(a);
178 unit_assert(memcmp(a, str, 8) == 0);
179
180 /* test if really zeroed */
181 a = regional_alloc_zero(r, 32);
182 str="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
183 unit_assert(a);
184 unit_assert(memcmp(a, str, 32) == 0);
185
186 /* test if copied over (and null byte) */
187 str = "an interesting string";
188 a = regional_strdup(r, str);
189 unit_assert(a);
190 unit_assert(memcmp(a, str, strlen(str)+1) == 0);
191
192 regional_free_all(r);
193 }
194
195 /** test specific cases */
196 static void
197 specific_cases()
198 {
199 struct regional* r = regional_create();
200 corner_cases(r);
201 regional_destroy(r);
202 r = regional_create_custom(2048); /* a small regional */
203 unit_assert(r->first_size == 2048);
204 unit_assert(regional_get_mem(r) == 2048);
205 corner_cases(r);
206 unit_assert(regional_get_mem(r) == 2048);
207 regional_destroy(r);
208 }
209
210 /** put random stuff in a region and free it */
211 static void
212 burden_test(size_t max)
213 {
214 size_t get;
215 void* a;
216 int i;
217 struct regional* r = regional_create_custom(2048);
218 for(i=0; i<1000; i++) {
219 get = random() % max;
220 a = regional_alloc(r, get);
221 unit_assert(a);
222 memset(a, 0x54, get);
223 }
224 regional_free_all(r);
225 regional_destroy(r);
226 }
227
228 /** randomly allocate stuff */
229 static void
230 random_burden()
231 {
232 size_t max_alloc = 2048 + 128; /* small chance of LARGE */
233 int i;
234 for(i=0; i<100; i++)
235 burden_test(max_alloc);
236 }
237
238 void regional_test()
239 {
240 unit_show_feature("regional");
241 specific_cases();
242 random_burden();
243 }
Binary diff not shown
0 example.com. 3600 IN DS 60385 12 3 c93b6fd6893d42ae60acd15088c2aeea0e0f013e535961855f17299507f70e0d ; xudef-ririt-kidaf-tebyp-vemep-segih-bydes-dyriv-pofab-zibaf-vigyh-numom-halac-lypin-hycaz-lofub-taxex
0 example.com. 3600 IN DNSKEY 256 3 12 9SZY+xB3wKtrLoRHzkBs9L3fjcvazjnk5HF3gMaD1PVp4pthrwgHIm0TUaLrd3YCa2VCl5wj+MzbhZi8NEJ/Cg== ;{id = 60385 (zsk), size = 512b}
0 Private-key-format: v1.2
1 Algorithm: 12 (ECC-GOST)
2 GostAsn1: MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIgIge0NaZG76WD9K6vNRD1yDuVPtKlEtFQbHIjoB106B6Hc=
+0
-1
testdata/Kexample.com.+249+41929.ds less more
0 example.com. 3600 IN DS 41929 249 203 10e2bc48d0301d16858bd040ee7d5c1983122d6cec0e3324fcdb94ba5ac0f748 ; xegav-dozog-mugef-bolyc-kicem-rygug-borel-tulyc-nibuc-dyryk-serub-vasud-gazut-rihyr-pykis-bytyg-myxyx
+0
-1
testdata/Kexample.com.+249+41929.key less more
0 example.com. 3600 IN DNSKEY 256 3 249 AAB7oZ5Ox8mcGrhB4vh41LdJQ5i+MVbn0KVe1a0CU2Akdwbp1qZ2khQTJZ0wOFkEsmgU2wfggXTpU8rp745IDVUb ;{id = 41929 (zsk), size = 512b}
+0
-3
testdata/Kexample.com.+249+41929.private less more
0 Private-key-format: v1.2
1 Algorithm: 249 (GOST)
2 GostAsn1: MEUCAQAwHAYGKoUDAgITMBIGByqFAwICIwEGByqFAwICHgEEIgIgZdfQ+s3ASjjFsne42OdGYxav0QKoL3p/wOX/3kySQ3Q=
Binary diff not shown
Binary diff not shown
22 ; first entry is a DNSKEY answer, with the DNSKEY rrset used for verification.
33 ; later entries are verified with it.
44
5 ; Test GOST signatures using algo number 249.
5 ; Test GOST signatures using algo number 12.
66
77 ENTRY_BEGIN
88 SECTION QUESTION
99 nlnetlabs.nl. IN DNSKEY
1010 SECTION ANSWER
11 nlnetlabs.nl. 3600 IN DNSKEY 256 3 249 AAB7oZ5Ox8mcGrhB4vh41LdJQ5i+MVbn0KVe1a0CU2Akdwbp1qZ2khQTJZ0wOFkEsmgU2wfggXTpU8rp745IDVUb ;{id = 41929 (zsk), size = 512b}
11 nlnetlabs.nl. 3600 IN DNSKEY 256 3 12 9SZY+xB3wKtrLoRHzkBs9L3fjcvazjnk5HF3gMaD1PVp4pthrwgHIm0TUaLrd3YCa2VCl5wj+MzbhZi8NEJ/Cg== ;{id = 60385 (zsk), size = 512b}
1212 ENTRY_END
1313
1414 ; entry to test
1717 open.nlnetlabs.nl. IN A
1818 SECTION ANSWER
1919 open.nlnetlabs.nl. 600 IN A 213.154.224.1
20 open.nlnetlabs.nl. 600 IN RRSIG A 249 3 600 20090903100515 20090806100515 41929 nlnetlabs.nl. jHGE+RPMlJtQBrmSEbw6ERLkuYR5hjiVMuj7HbxpfGi63A/Tm5zRZaEgx9AK+gvEXMo2d9TN44OaBxPNyxgQNA== ;{id = 41929}
20 open.nlnetlabs.nl. 600 IN RRSIG A 12 3 600 20090903100515 20090806100515 60385 nlnetlabs.nl. XVxDmt7/gRk13Yv+U+RPuEZ86iCGSVPmTcpMZYJs14Yn6Y/On8X+vgLV6IzxQTxAwGb+D35/dUfT55p6pFo8YQ== ;{id = 60385}
2121 ENTRY_END
2222
2323 ENTRY_BEGIN
2626 SECTION ANSWER
2727 open.nlnetlabs.nl. 600 IN AAAA 2001:7b8:206:1::1
2828 open.nlnetlabs.nl. 600 IN AAAA 2001:7b8:206:1::53
29 open.nlnetlabs.nl. 600 IN RRSIG AAAA 249 3 600 20090903100515 20090806100515 41929 nlnetlabs.nl. Pod5ouQTmulD8rmOOERVhhD3wsu7tD2VRej+Puph61T/vEry0CTnosHkd4fg2xohnx9i6m09LhPeOdaCJJIRAQ== ;{id = 41929}
29 open.nlnetlabs.nl. 600 IN RRSIG AAAA 12 3 600 20090903100515 20090806100515 60385 nlnetlabs.nl. +tdW+Uhkl2dBsD3zjGFGg1UtkBgfEhM6aXzERl0gWElgoJ4pCpXTV7VhZQ4yjibpMYjcXsBhQLcN7AuG20Ps9Q== ;{id = 60385}
3030 ENTRY_END
3131
3232 ENTRY_BEGIN
3434 open.nlnetlabs.nl. IN NSEC
3535 SECTION ANSWER
3636 open.nlnetlabs.nl. 3600 IN NSEC nlnetlabs.nl. A AAAA RRSIG NSEC
37 open.nlnetlabs.nl. 3600 IN RRSIG NSEC 249 3 3600 20090903100515 20090806100515 41929 nlnetlabs.nl. qWNarmPDHjv+ctxYCbxWrJc+LPjKW+RkP17bK6idfzcqGxK95fnsduphbmEZlQQiruO1OeZ1VlF9Btg+qS2T3A== ;{id = 41929}
37 open.nlnetlabs.nl. 3600 IN RRSIG NSEC 12 3 3600 20090903100515 20090806100515 60385 nlnetlabs.nl. vOzQQh9ITdgD74ohIE37L8mAZcgDt7V+HrrPjCdalsFYw9dvGwuEvc0MfSDmzrFQ7OhL0elwI/A1AfK57M7emQ== ;{id = 60385}
3838 ENTRY_END
3939
0 ; config options
1 ; The island of trust is at example.com
2 server:
3 trust-anchor: "example.com. 3600 IN DS 2854 3 1 46e4ffc6e9a4793b488954bd3f0cc6af0dfb201b"
4 val-override-date: "20070916134226"
5 target-fetch-policy: "0 0 0 0 0"
6
7 stub-zone:
8 name: "."
9 stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.
10 CONFIG_END
11
12 SCENARIO_BEGIN Test validator with CNAME response to DS
13
14 ; K.ROOT-SERVERS.NET.
15 RANGE_BEGIN 0 100
16 ADDRESS 193.0.14.129
17 ENTRY_BEGIN
18 MATCH opcode qtype qname
19 ADJUST copy_id
20 REPLY QR NOERROR
21 SECTION QUESTION
22 . IN NS
23 SECTION ANSWER
24 . IN NS K.ROOT-SERVERS.NET.
25 SECTION ADDITIONAL
26 K.ROOT-SERVERS.NET. IN A 193.0.14.129
27 ENTRY_END
28
29 ENTRY_BEGIN
30 MATCH opcode qtype qname
31 ADJUST copy_id
32 REPLY QR NOERROR
33 SECTION QUESTION
34 www.example.com. IN A
35 SECTION AUTHORITY
36 com. IN NS a.gtld-servers.net.
37 SECTION ADDITIONAL
38 a.gtld-servers.net. IN A 192.5.6.30
39 ENTRY_END
40 RANGE_END
41
42 ; a.gtld-servers.net.
43 RANGE_BEGIN 0 100
44 ADDRESS 192.5.6.30
45 ENTRY_BEGIN
46 MATCH opcode qtype qname
47 ADJUST copy_id
48 REPLY QR NOERROR
49 SECTION QUESTION
50 com. IN NS
51 SECTION ANSWER
52 com. IN NS a.gtld-servers.net.
53 SECTION ADDITIONAL
54 a.gtld-servers.net. IN A 192.5.6.30
55 ENTRY_END
56
57 ENTRY_BEGIN
58 MATCH opcode qtype qname
59 ADJUST copy_id
60 REPLY QR NOERROR
61 SECTION QUESTION
62 www.example.com. IN A
63 SECTION AUTHORITY
64 example.com. IN NS ns.example.com.
65 SECTION ADDITIONAL
66 ns.example.com. IN A 1.2.3.4
67 ENTRY_END
68
69 ENTRY_BEGIN
70 MATCH opcode qtype qname
71 ADJUST copy_id
72 REPLY QR AA NOERROR
73 SECTION QUESTION
74 ns.example.com. IN AAAA
75 SECTION ANSWER
76 ENTRY_END
77 RANGE_END
78
79 ; ns.example.com.
80 RANGE_BEGIN 0 100
81 ADDRESS 1.2.3.4
82 ENTRY_BEGIN
83 MATCH opcode qtype qname
84 ADJUST copy_id
85 REPLY QR NOERROR
86 SECTION QUESTION
87 example.com. IN NS
88 SECTION ANSWER
89 example.com. IN NS ns.example.com.
90 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
91 SECTION ADDITIONAL
92 ns.example.com. IN A 1.2.3.4
93 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
94 ENTRY_END
95
96 ; response to DNSKEY priming query
97 ENTRY_BEGIN
98 MATCH opcode qtype qname
99 ADJUST copy_id
100 REPLY QR NOERROR
101 SECTION QUESTION
102 example.com. IN DNSKEY
103 SECTION ANSWER
104 example.com. 3600 IN DNSKEY 256 3 3 ALXLUsWqUrY3JYER3T4TBJII s70j+sDS/UT2QRp61SE7S3E EXopNXoFE73JLRmvpi/UrOO/Vz4Se 6wXv/CYCKjGw06U4WRgR YXcpEhJROyNapmdIKSx hOzfLVE1gqA0PweZR8d tY3aNQSRn3sPpwJr6Mi /PqQKAMMrZ9ckJpf1+b QMOOvxgzz2U1GS18b3y ZKcgTMEaJzd/GZYzi/B N2DzQ0MsrSwYXfsNLFO Bbs8PJMW4LYIxeeOe6rUgkWOF 7CC9Dh/dduQ1QrsJhmZAEFfd6ByYV+ ;{id = 2854 (zsk), size = 1688b}
105 example.com. 3600 IN RRSIG DNSKEY 3 2 3600 20070926134802 20070829134802 2854 example.com. MCwCFG1yhRNtTEa3Eno2zhVVuy2EJX3wAhQeLyUp6+UXcpC5qGNu9tkrTEgPUg== ;{id = 2854}
106 SECTION AUTHORITY
107 example.com. IN NS ns.example.com.
108 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
109 SECTION ADDITIONAL
110 ns.example.com. IN A 1.2.3.4
111 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
112 ENTRY_END
113
114 ; response to query of interest
115 ENTRY_BEGIN
116 MATCH opcode qtype qname
117 ADJUST copy_id
118 REPLY QR AA NOERROR
119 SECTION QUESTION
120 www.example.com. IN A
121 SECTION ANSWER
122 ; nothing here, not even NSECs
123 SECTION AUTHORITY
124 example.com. IN NS ns.example.com.
125 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
126 SECTION ADDITIONAL
127 ENTRY_END
128
129 ; DS query
130 ENTRY_BEGIN
131 MATCH opcode qtype qname
132 ADJUST copy_id
133 REPLY QR AA NOERROR
134 SECTION QUESTION
135 www.example.com. IN DS
136 SECTION ANSWER
137 www.example.com. IN CNAME zzz.example.com.
138 www.example.com. 3600 IN RRSIG CNAME 3 2 3600 20070926134150 20070829134150 2854 example.com. AERsv3PiBObAEhZ/dKyamie0sjvYLn7YaEKgv9ExB14KKLgWvzCaOWo= ;{id = 2854}
139 ;*.example.com. IN CNAME zzz.example.com.
140 ;*.example.com. 3600 IN RRSIG CNAME 3 2 3600 20070926134150 20070829134150 2854 example.com. AERsv3PiBObAEhZ/dKyamie0sjvYLn7YaEKgv9ExB14KKLgWvzCaOWo= ;{id = 2854}
141
142 SECTION AUTHORITY
143 *.example.com. IN NSEC zzz.example.com. CNAME RRSIG NSEC
144 *.example.com. 3600 IN RRSIG NSEC 3 2 3600 20070926134150 20070829134150 2854 example.com. AJxl2TXciyhbKqSakVNtjlt8Bbkco02zpl5RlY88iqVmSa6ts+/guU4= ;{id = 2854}
145 zzz.example.com. IN NSEC *.zzz.example.com. A RRSIG NSEC
146 zzz.example.com. 3600 IN RRSIG NSEC 3 3 3600 20070926134150 20070829134150 2854 example.com. ACtgx/h0YfGEK79zg4G16jB/0oRWH0nxrMzUc/4hCY3oprsP8DrdjqU= ;{id = 2854}
147 example.com. IN SOA alfa.ns.example.com.cz. hostmaster.example.com. 2010030800 10800 86400 604800 86400
148 example.com. 3600 IN RRSIG SOA 3 2 3600 20070926134150 20070829134150 2854 example.com. ADsxLOHjxFzwFmwIiGOubqD9nKWAp4RccRIXQ0+EAUGfSDZMCB0ZiFA= ;{id = 2854}
149 SECTION ADDITIONAL
150 ENTRY_END
151
152 ENTRY_BEGIN
153 MATCH opcode qtype qname
154 ADJUST copy_id
155 REPLY QR AA NOERROR
156 SECTION QUESTION
157 zzz.example.com. IN DS
158 SECTION ANSWER
159 SECTION AUTHORITY
160 zzz.example.com. IN NSEC *.zzz.example.com. A RRSIG NSEC
161 zzz.example.com. 3600 IN RRSIG NSEC 3 3 3600 20070926134150 20070829134150 2854 example.com. ACtgx/h0YfGEK79zg4G16jB/0oRWH0nxrMzUc/4hCY3oprsP8DrdjqU= ;{id = 2854}
162 example.com. IN SOA alfa.ns.example.com.cz. hostmaster.example.com. 2010030800 10800 86400 604800 86400
163 example.com. 3600 IN RRSIG SOA 3 2 3600 20070926134150 20070829134150 2854 example.com. ADsxLOHjxFzwFmwIiGOubqD9nKWAp4RccRIXQ0+EAUGfSDZMCB0ZiFA= ;{id = 2854}
164 SECTION ADDITIONAL
165 ENTRY_END
166 RANGE_END
167
168 STEP 1 QUERY
169 ENTRY_BEGIN
170 REPLY RD DO
171 SECTION QUESTION
172 www.example.com. IN A
173 ENTRY_END
174
175 ; recursion happens here.
176 STEP 10 CHECK_ANSWER
177 ENTRY_BEGIN
178 MATCH all
179 REPLY QR RD RA SERVFAIL
180 SECTION QUESTION
181 www.example.com. IN A
182 SECTION ANSWER
183 ENTRY_END
184
185 SCENARIO_END
114114 sub.example.com. IN NS ns.sub.example.com.
115115
116116 ; GOST DS for sub.example.com.
117 sub.example.com. 3600 IN DS 41930 249 203 1940ede41068d30064a092a4fbf50b95071497a6c96616d647023c2e31951c59 ; xekeg-beryv-gygek-mugab-benup-bugop-gyvoz-hidin-hicec-gohap-keduk-kyhet-kucob-duzed-vason-halih-noxox
118 sub.example.com. 3600 IN RRSIG DS 3 3 3600 20070926135752 20070829135752 2854 example.com. AE9dudjtl6lDkd56NGXQrsT9OsYXKJBipHfdnX+UyR10CydCRFju8Mk= ;{id = 2854}
117 sub.example.com. 3600 IN DS 60385 12 3 2be04f63b3d069fd65f81a3b810b661a00d39be3ff00d1c7481a150b93b0d027 ; xepov-bofek-fuset-bipiz-tunoz-mukyf-rybyb-ranic-pobet-fakov-fozob-bagus-ludac-pyheb-rygor-bygyd-lyxyx
119118
120119 ; SHA DS for sub.example.com.
121 ;sub.example.com. 3600 IN DS 41930 249 1 ea843e16f46363ad869661a7e88fe5d4bfd63796 ; xupim-gyzoc-kutek-femup-tucen-kemyp-lopym-zanit-gizet-kotyn-kuxyx
120 ;sub.example.com. 3600 IN DS 60385 12 1 0a66f7923318bb1e208bfd975ffa2e30cfcdf962 ; xedik-katin-dasec-myvic-vumum-rizan-luluz-paraf-befas-tovek-dyxax
121 ;sub.example.com. 3600 IN DS 60385 12 2 cd3290b84b457d02ca29846a005a5eba61640256ced8deca0ef8345d2cd34a58 ; xufef-dugir-modog-hyzyb-dadod-nicuk-pubyh-polor-pomuk-gobuh-kufet-mulus-pofyz-metoh-tarit-fudih-moxex
122
123 sub.example.com. 3600 IN RRSIG DS 3 3 3600 20070926135752 20070829135752 2854 example.com. ADwjiGkzrz8RPRJ6LAB37cNEQxTXSaR6Stu/GwGvcQ7KVGH/Qw76ktI= ;{id = 2854}
122124
123125 SECTION ADDITIONAL
124126 ns.sub.example.com. IN A 1.2.3.6
137139 sub.example.com. IN NS
138140 SECTION ANSWER
139141 sub.example.com. IN NS ns.sub.example.com.
140 sub.example.com. 3600 IN RRSIG NS 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. +RqxwrGqIOwgZit1MNe3oEPEvoTRppVylmLFXAT7tg2MxWBdqXwH1Pby3sbAy6T3Syk07LMEjZJ/qd5HYJO0+w== ;{id = 41930}
142 sub.example.com. 3600 IN RRSIG NS 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. LAgerMKnwGgapo7tDs2jV8kjA+RminByvkR6qHineRDv4SYbRdDlCtYcFR4CoYo9aigLPej1WBmaZjFV+/7AVA== ;{id = 60385}
141143 SECTION ADDITIONAL
142144 ns.sub.example.com. IN A 1.2.3.6
143 ns.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. T7CSlknnb6GnM8hS9riryi9G06nr/2nJUfep97igb+aPgrLziF0UUVj3DjcISgmrCw0Pdegm2jJkVliFYm4PLQ== ;{id = 41930}
145 ns.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. qYVQEwiVNWwRRoDJxK3c3LaXtfvOm/YzOEzXbN2MxPHZXHaa2nCzWLsILNstot/wTAbrk4wNcT16gKxF5JguNw== ;{id = 60385}
144146 ENTRY_END
145147
146148 ; response to DNSKEY priming query
151153 SECTION QUESTION
152154 sub.example.com. IN DNSKEY
153155 SECTION ANSWER
154 sub.example.com. 3600 IN DNSKEY 257 3 249 AAB7oZ5Ox8mcGrhB4vh41LdJQ5i+MVbn0KVe1a0CU2Akdwbp1qZ2khQTJZ0wOFkEsmgU2wfggXTpU8rp745IDVUb ;{id = 41930 (zsk), size = 512b}
155 sub.example.com. 3600 IN RRSIG DNSKEY 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. AEZeCPrvG8ueQYicdYhBUMORPH8VHlbcO0GvsRl5xLFqc8femC2qPRk7SpIOSRxZXdu4liL9O5FFYaymThfFCA== ;{id = 41930}
156 sub.example.com. 3600 IN DNSKEY 256 3 12 9SZY+xB3wKtrLoRHzkBs9L3fjcvazjnk5HF3gMaD1PVp4pthrwgHIm0TUaLrd3YCa2VCl5wj+MzbhZi8NEJ/Cg== ;{id = 60385 (zsk), size = 512b}
157 sub.example.com. 3600 IN RRSIG DNSKEY 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. zyZCppfMjlMS9xs3pJfbWkdA6EgV5MqI11AdVRV8pBsyI7diYLWm8RAHlhEI5MT59A6IT6Di9YjOCvWJjzZ9tA== ;{id = 60385}
156158 SECTION AUTHORITY
157159 sub.example.com. IN NS ns.sub.example.com.
158 sub.example.com. 3600 IN RRSIG NS 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. +RqxwrGqIOwgZit1MNe3oEPEvoTRppVylmLFXAT7tg2MxWBdqXwH1Pby3sbAy6T3Syk07LMEjZJ/qd5HYJO0+w== ;{id = 41930}
160 sub.example.com. 3600 IN RRSIG NS 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. 3y6qmOn5GIytQQtXmdhkyL0+8Um7uNzOA0m0CkWFtzN81T98jHdGcCGNC3CIGMyhKaWKqPlOoSwIfm55fa4qRA== ;{id = 60385}
159161
160162 SECTION ADDITIONAL
161163 ns.sub.example.com. IN A 1.2.3.6
162 ns.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. T7CSlknnb6GnM8hS9riryi9G06nr/2nJUfep97igb+aPgrLziF0UUVj3DjcISgmrCw0Pdegm2jJkVliFYm4PLQ== ;{id = 41930}
164 ns.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. VS97UxG9Kn7DIYFCnBDJQ3n7sQ+aYF42/cU6s8jF1Y4nHSorKPFa0KHn0WVmaW33hA+Vs4BWTvJ1/JOpbiJskA== ;{id = 60385}
165
163166 ENTRY_END
164167
165168 ; response to query of interest
171174 www.sub.example.com. IN A
172175 SECTION ANSWER
173176 www.sub.example.com. IN A 11.11.11.11
174 www.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. UUeLd4U/s4Bp2772GGbjFGc+JiiqL9VCSCRkSIPPIzCm7ECWNhpi+a3eG4oC4Z99ufpcP+v67FuAWlAGXyeW0A== ;{id = 41930}
177 www.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. KVDpNBH83UM8l1e9yAdXA1fV+wFJSJF4NtOnDLTtbpfyVbndNW3tvPc2YfLBxTEZeUCns2QrqcmIMdZ086frOQ== ;{id = 60385}
175178
176179 SECTION AUTHORITY
177180 SECTION ADDITIONAL
194197 www.sub.example.com. IN A
195198 SECTION ANSWER
196199 www.sub.example.com. 3600 IN A 11.11.11.11
197 www.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. UUeLd4U/s4Bp2772GGbjFGc+JiiqL9VCSCRkSIPPIzCm7ECWNhpi+a3eG4oC4Z99ufpcP+v67FuAWlAGXyeW0A== ;{id = 41930}
200 www.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. KVDpNBH83UM8l1e9yAdXA1fV+wFJSJF4NtOnDLTtbpfyVbndNW3tvPc2YfLBxTEZeUCns2QrqcmIMdZ086frOQ== ;{id = 60385}
198201 SECTION AUTHORITY
199202 SECTION ADDITIONAL
200203 ENTRY_END
123123
124124 ; downgrade: false GOST, correct SHA
125125
126 sub.example.com. 3600 IN DS 41930 249 203 1940ede41068d30064a092a4fbf50b95071497a6c96616d647023c2e31951c58 ; xekeg-beryv-gygek-mugab-benup-bugop-gyvoz-hidin-hicec-gohap-keduk-kyhet-kucob-duzed-vason-halih-noxox
126
127 sub.example.com. 3600 IN DS 60385 12 3 2be04f63b3d069fd65f81a3b810b661a00d39be3ff00d1c7481a150b93b0d028
127128
128129 ; correct GOST DS for sub.example.com.
129 ; sub.example.com. 3600 IN DS 41930 249 203 1940ede41068d30064a092a4fbf50b95071497a6c96616d647023c2e31951c59 ; xekeg-beryv-gygek-mugab-benup-bugop-gyvoz-hidin-hicec-gohap-keduk-kyhet-kucob-duzed-vason-halih-noxox
130 ; sub.example.com. 3600 IN DS 60385 12 3 2be04f63b3d069fd65f81a3b810b661a00d39be3ff00d1c7481a150b93b0d027 ; xepov-bofek-fuset-bipiz-tunoz-mukyf-rybyb-ranic-pobet-fakov-fozob-bagus-ludac-pyheb-rygor-bygyd-lyxyx
130131
131132 ; SHA1 DS for sub.example.com.
132 sub.example.com. 3600 IN DS 41930 249 1 ea843e16f46363ad869661a7e88fe5d4bfd63796 ; xupim-gyzoc-kutek-femup-tucen-kemyp-lopym-zanit-gizet-kotyn-kuxyx
133 sub.example.com. 3600 IN DS 60385 12 1 0a66f7923318bb1e208bfd975ffa2e30cfcdf962 ; xedik-katin-dasec-myvic-vumum-rizan-luluz-paraf-befas-tovek-dyxax
133134 ; SHA256 DS for sub.example.com.
134 sub.example.com. 3600 IN DS 41930 249 2 0ae431b6bbb6ded8547428517c0912aab06150e3fe3e0bb64755e6baa4e33bb5 ; xediv-gosor-kiver-kalat-muhyl-gypah-cozub-nygep-pysak-cegiv-fuzyf-voder-kycih-hyner-piniv-fevir-hyxux
135
135 sub.example.com. 3600 IN DS 60385 12 2 cd3290b84b457d02ca29846a005a5eba61640256ced8deca0ef8345d2cd34a58 ; xufef-dugir-modog-hyzyb-dadod-nicuk-pubyh-polor-pomuk-gobuh-kufet-mulus-pofyz-metoh-tarit-fudih-moxex
136136
137137 ; signs SHA1, SHA2 and GOST DSes
138 sub.example.com. 3600 IN RRSIG DS 3 3 3600 20070926135752 20070829135752 2854 example.com. AEEGV20ThZAE523wZe4idjxcv/wHBgA/UUWk+H5V5c1bRGa2VzLLuDM= ;{id = 2854}
138 sub.example.com. 3600 IN RRSIG DS 3 3 3600 20070926135752 20070829135752 2854 example.com. ADB1PPtGoPKRrhNtRtkqeqpgnZdbPOdJMgjdZVxPfgGCoMTu3JFQVbo= ;{id = 2854}
139139
140140 SECTION ADDITIONAL
141141 ns.sub.example.com. IN A 1.2.3.6
154154 sub.example.com. IN NS
155155 SECTION ANSWER
156156 sub.example.com. IN NS ns.sub.example.com.
157 sub.example.com. 3600 IN RRSIG NS 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. +RqxwrGqIOwgZit1MNe3oEPEvoTRppVylmLFXAT7tg2MxWBdqXwH1Pby3sbAy6T3Syk07LMEjZJ/qd5HYJO0+w== ;{id = 41930}
157 sub.example.com. 3600 IN RRSIG NS 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. 6mNrX32/DC2RU1A+yWCccn5H6wnsbNYTlf8e/LyF1fsuNfw6tH12sKGBCtk1mp4HpDIgH02HDHplJskSFOvzTw== ;{id = 60385}
158
158159 SECTION ADDITIONAL
159160 ns.sub.example.com. IN A 1.2.3.6
160 ns.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. T7CSlknnb6GnM8hS9riryi9G06nr/2nJUfep97igb+aPgrLziF0UUVj3DjcISgmrCw0Pdegm2jJkVliFYm4PLQ== ;{id = 41930}
161 ns.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. kJEyinL7BkpiPW2HxmFHRLAi68EdrLXToJiK83a5cedDe5ABL7c/k+nFHd3WjATUtVoueY3pSnCDVCJaFmd+/A== ;{id = 60385}
161162 ENTRY_END
162163
163164 ; response to DNSKEY priming query
168169 SECTION QUESTION
169170 sub.example.com. IN DNSKEY
170171 SECTION ANSWER
171 sub.example.com. 3600 IN DNSKEY 257 3 249 AAB7oZ5Ox8mcGrhB4vh41LdJQ5i+MVbn0KVe1a0CU2Akdwbp1qZ2khQTJZ0wOFkEsmgU2wfggXTpU8rp745IDVUb ;{id = 41930 (zsk), size = 512b}
172 sub.example.com. 3600 IN RRSIG DNSKEY 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. AEZeCPrvG8ueQYicdYhBUMORPH8VHlbcO0GvsRl5xLFqc8femC2qPRk7SpIOSRxZXdu4liL9O5FFYaymThfFCA== ;{id = 41930}
172 sub.example.com. 3600 IN DNSKEY 256 3 12 9SZY+xB3wKtrLoRHzkBs9L3fjcvazjnk5HF3gMaD1PVp4pthrwgHIm0TUaLrd3YCa2VCl5wj+MzbhZi8NEJ/Cg== ;{id = 60385 (zsk), size = 512b}
173 sub.example.com. 3600 IN RRSIG DNSKEY 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. zyZCppfMjlMS9xs3pJfbWkdA6EgV5MqI11AdVRV8pBsyI7diYLWm8RAHlhEI5MT59A6IT6Di9YjOCvWJjzZ9tA== ;{id = 60385}
173174 SECTION AUTHORITY
174175 sub.example.com. IN NS ns.sub.example.com.
175 sub.example.com. 3600 IN RRSIG NS 249 3 3600 20070926134150 20070829134150 41930 sub.example.com. +RqxwrGqIOwgZit1MNe3oEPEvoTRppVylmLFXAT7tg2MxWBdqXwH1Pby3sbAy6T3Syk07LMEjZJ/qd5HYJO0+w== ;{id = 41930}
176 sub.example.com. 3600 IN RRSIG NS 12 3 3600 20070926134150 20070829134150 60385 sub.example.com. 6mNrX32/DC2RU1A+yWCccn5H6wnsbNYTlf8e/LyF1fsuNfw6tH12sKGBCtk1mp4HpDIgH02HDHplJskSFOvzTw== ;{id = 60385}
176177 SECTION ADDITIONAL
177178 ns.sub.example.com. IN A 1.2.3.6
178 ns.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. T7CSlknnb6GnM8hS9riryi9G06nr/2nJUfep97igb+aPgrLziF0UUVj3DjcISgmrCw0Pdegm2jJkVliFYm4PLQ== ;{id = 41930}
179 ns.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. kJEyinL7BkpiPW2HxmFHRLAi68EdrLXToJiK83a5cedDe5ABL7c/k+nFHd3WjATUtVoueY3pSnCDVCJaFmd+/A== ;{id = 60385}
179180 ENTRY_END
180181
181182 ; response to query of interest
187188 www.sub.example.com. IN A
188189 SECTION ANSWER
189190 www.sub.example.com. IN A 11.11.11.11
190 www.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. UUeLd4U/s4Bp2772GGbjFGc+JiiqL9VCSCRkSIPPIzCm7ECWNhpi+a3eG4oC4Z99ufpcP+v67FuAWlAGXyeW0A== ;{id = 41930}
191 www.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. KVDpNBH83UM8l1e9yAdXA1fV+wFJSJF4NtOnDLTtbpfyVbndNW3tvPc2YfLBxTEZeUCns2QrqcmIMdZ086frOQ== ;{id = 60385}
191192
192193 SECTION AUTHORITY
193194 SECTION ADDITIONAL
220221 www.sub.example.com. IN A
221222 SECTION ANSWER
222223 ;www.sub.example.com. 3600 IN A 11.11.11.11
223 ;www.sub.example.com. 3600 IN RRSIG A 249 4 3600 20070926134150 20070829134150 41930 sub.example.com. UUeLd4U/s4Bp2772GGbjFGc+JiiqL9VCSCRkSIPPIzCm7ECWNhpi+a3eG4oC4Z99ufpcP+v67FuAWlAGXyeW0A== ;{id = 41930}
224 ;www.sub.example.com. 3600 IN RRSIG A 12 4 3600 20070926134150 20070829134150 60385 sub.example.com. KVDpNBH83UM8l1e9yAdXA1fV+wFJSJF4NtOnDLTtbpfyVbndNW3tvPc2YfLBxTEZeUCns2QrqcmIMdZ086frOQ== ;{id = 60385}
224225 SECTION AUTHORITY
225226 SECTION ADDITIONAL
226227 ENTRY_END
0 ; config options
1 ; The island of trust is at example.com
2 server:
3 trust-anchor: "example.com. 3600 IN DS 2854 3 1 46e4ffc6e9a4793b488954bd3f0cc6af0dfb201b"
4 val-override-date: "20070916134226"
5 target-fetch-policy: "0 0 0 0 0"
6
7 stub-zone:
8 name: "."
9 stub-addr: 193.0.14.129 # K.ROOT-SERVERS.NET.
10 CONFIG_END
11
12 SCENARIO_BEGIN Test validator with direct wildcard positive response
13
14 ; K.ROOT-SERVERS.NET.
15 RANGE_BEGIN 0 100
16 ADDRESS 193.0.14.129
17 ENTRY_BEGIN
18 MATCH opcode qtype qname
19 ADJUST copy_id
20 REPLY QR NOERROR
21 SECTION QUESTION
22 . IN NS
23 SECTION ANSWER
24 . IN NS K.ROOT-SERVERS.NET.
25 SECTION ADDITIONAL
26 K.ROOT-SERVERS.NET. IN A 193.0.14.129
27 ENTRY_END
28
29 ENTRY_BEGIN
30 MATCH opcode qtype qname
31 ADJUST copy_id
32 REPLY QR NOERROR
33 SECTION QUESTION
34 *.example.com. IN A
35 SECTION AUTHORITY
36 com. IN NS a.gtld-servers.net.
37 SECTION ADDITIONAL
38 a.gtld-servers.net. IN A 192.5.6.30
39 ENTRY_END
40 RANGE_END
41
42 ; a.gtld-servers.net.
43 RANGE_BEGIN 0 100
44 ADDRESS 192.5.6.30
45 ENTRY_BEGIN
46 MATCH opcode qtype qname
47 ADJUST copy_id
48 REPLY QR NOERROR
49 SECTION QUESTION
50 com. IN NS
51 SECTION ANSWER
52 com. IN NS a.gtld-servers.net.
53 SECTION ADDITIONAL
54 a.gtld-servers.net. IN A 192.5.6.30
55 ENTRY_END
56
57 ENTRY_BEGIN
58 MATCH opcode qtype qname
59 ADJUST copy_id
60 REPLY QR NOERROR
61 SECTION QUESTION
62 *.example.com. IN A
63 SECTION AUTHORITY
64 example.com. IN NS ns.example.com.
65 SECTION ADDITIONAL
66 ns.example.com. IN A 1.2.3.4
67 ENTRY_END
68
69 ENTRY_BEGIN
70 MATCH opcode qtype qname
71 ADJUST copy_id
72 REPLY QR NOERROR
73 SECTION QUESTION
74 ns.example.com. IN AAAA
75 SECTION ANSWER
76 ENTRY_END
77 RANGE_END
78
79 ; ns.example.com.
80 RANGE_BEGIN 0 100
81 ADDRESS 1.2.3.4
82 ENTRY_BEGIN
83 MATCH opcode qtype qname
84 ADJUST copy_id
85 REPLY QR NOERROR
86 SECTION QUESTION
87 example.com. IN NS
88 SECTION ANSWER
89 example.com. IN NS ns.example.com.
90 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
91 SECTION ADDITIONAL
92 ns.example.com. IN A 1.2.3.4
93 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
94 ENTRY_END
95
96 ; response to DNSKEY priming query
97 ENTRY_BEGIN
98 MATCH opcode qtype qname
99 ADJUST copy_id
100 REPLY QR NOERROR
101 SECTION QUESTION
102 example.com. IN DNSKEY
103 SECTION ANSWER
104 example.com. 3600 IN DNSKEY 256 3 3 ALXLUsWqUrY3JYER3T4TBJII s70j+sDS/UT2QRp61SE7S3E EXopNXoFE73JLRmvpi/UrOO/Vz4Se 6wXv/CYCKjGw06U4WRgR YXcpEhJROyNapmdIKSx hOzfLVE1gqA0PweZR8d tY3aNQSRn3sPpwJr6Mi /PqQKAMMrZ9ckJpf1+b QMOOvxgzz2U1GS18b3y ZKcgTMEaJzd/GZYzi/B N2DzQ0MsrSwYXfsNLFO Bbs8PJMW4LYIxeeOe6rUgkWOF 7CC9Dh/dduQ1QrsJhmZAEFfd6ByYV+ ;{id = 2854 (zsk), size = 1688b}
105 example.com. 3600 IN RRSIG DNSKEY 3 2 3600 20070926134802 20070829134802 2854 example.com. MCwCFG1yhRNtTEa3Eno2zhVVuy2EJX3wAhQeLyUp6+UXcpC5qGNu9tkrTEgPUg== ;{id = 2854}
106 SECTION AUTHORITY
107 example.com. IN NS ns.example.com.
108 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
109 SECTION ADDITIONAL
110 ns.example.com. IN A 1.2.3.4
111 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926135752 20070829135752 2854 example.com. MC0CFQCMSWxVehgOQLoYclB9PIAbNP229AIUeH0vNNGJhjnZiqgIOKvs1EhzqAo= ;{id = 2854}
112 ENTRY_END
113
114 ; response to query of interest
115 ENTRY_BEGIN
116 MATCH opcode qtype qname
117 ADJUST copy_id
118 REPLY QR NOERROR
119 SECTION QUESTION
120 *.example.com. IN A
121 SECTION ANSWER
122 *.example.com. IN A 10.20.30.40
123 *.example.com. 3600 IN RRSIG A 3 2 3600 20070926134150 20070829134150 2854 example.com. AG3iIIzflgRHsIlOKiSHADHIn/NmfNgESAslc1wIjxys5r9w4CxNIGs= ;{id = 2854}
124 SECTION AUTHORITY
125 example.com. IN NS ns.example.com.
126 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
127 SECTION ADDITIONAL
128 ns.example.com. IN A 1.2.3.4
129 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCQMyTjn7WWwpwAR1LlVeLpRgZGuQIUCcJDEkwAuzytTDRlYK7nIMwH1CM= ;{id = 2854}
130 ENTRY_END
131 RANGE_END
132
133 STEP 1 QUERY
134 ENTRY_BEGIN
135 REPLY RD DO
136 SECTION QUESTION
137 *.example.com. IN A
138 ENTRY_END
139
140 ; recursion happens here.
141 STEP 10 CHECK_ANSWER
142 ENTRY_BEGIN
143 MATCH all
144 REPLY QR RD RA AD NOERROR
145 SECTION QUESTION
146 *.example.com. IN A
147 SECTION ANSWER
148 *.example.com. IN A 10.20.30.40
149 *.example.com. 3600 IN RRSIG A 3 2 3600 20070926134150 20070829134150 2854 example.com. AG3iIIzflgRHsIlOKiSHADHIn/NmfNgESAslc1wIjxys5r9w4CxNIGs= ;{id = 2854}
150 SECTION AUTHORITY
151 example.com. IN NS ns.example.com.
152 example.com. 3600 IN RRSIG NS 3 2 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCN+qHdJxoI/2tNKwsb08pra/G7aAIUAWA5sDdJTbrXA1/3OaesGBAO3sI= ;{id = 2854}
153 SECTION ADDITIONAL
154 ns.example.com. IN A 1.2.3.4
155 ns.example.com. 3600 IN RRSIG A 3 3 3600 20070926134150 20070829134150 2854 example.com. MC0CFQCQMyTjn7WWwpwAR1LlVeLpRgZGuQIUCcJDEkwAuzytTDRlYK7nIMwH1CM= ;{id = 2854}
156 ENTRY_END
157
158 SCENARIO_END
176176 void* arg);
177177
178178 #ifdef UNBOUND_ALLOC_LITE
179 # include "ldns/packet.h"
180 # include "openssl/ssl.h"
179181 # define malloc(s) unbound_stat_malloc_lite(s, __FILE__, __LINE__, __func__)
180182 # define calloc(n,s) unbound_stat_calloc_lite(n, s, __FILE__, __LINE__, __func__)
181183 # define free(p) unbound_stat_free_lite(p, __FILE__, __LINE__, __func__)
3939 */
4040
4141 #include "config.h"
42 #include <ctype.h>
43 #include "ldns/ldns.h"
4244 #include "util/log.h"
4345
4446 #include "util/configyyrename.h"
527529 else O_DEC(opt, "statistics-interval", stat_interval)
528530 else O_YNO(opt, "statistics-cumulative", stat_cumulative)
529531 else O_YNO(opt, "extended-statistics", stat_extended)
532 else O_YNO(opt, "use-syslog", use_syslog)
530533 else O_DEC(opt, "num-threads", num_threads)
531534 else O_IFC(opt, "interface", num_ifs, ifs)
532535 else O_IFC(opt, "outgoing-interface", num_out_ifs, out_ifs)
3939 */
4040
4141 #include "config.h"
42 #include <ctype.h>
4243 #include "util/data/dname.h"
4344 #include "util/data/msgparse.h"
4445 #include "util/log.h"
146147 pkt_dname_tolower(ldns_buffer* pkt, uint8_t* dname)
147148 {
148149 uint8_t lablen;
150 int count = 0;
151 if(dname >= ldns_buffer_end(pkt))
152 return;
149153 lablen = *dname++;
150154 while(lablen) {
151155 if(LABEL_IS_PTR(lablen)) {
156 if((size_t)PTR_OFFSET(lablen, *dname)
157 >= ldns_buffer_limit(pkt))
158 return;
152159 dname = ldns_buffer_at(pkt, PTR_OFFSET(lablen, *dname));
153160 lablen = *dname++;
161 if(count++ > MAX_COMPRESS_PTRS)
162 return;
154163 continue;
155164 }
165 if(dname+lablen >= ldns_buffer_end(pkt))
166 return;
156167 while(lablen--) {
157168 *dname = (uint8_t)tolower((int)*dname);
158169 dname++;
159170 }
171 if(dname >= ldns_buffer_end(pkt))
172 return;
160173 lablen = *dname++;
161174 }
162175 }
3939 */
4040
4141 #include "config.h"
42 #include "ldns/wire2host.h"
4243 #include "util/data/msgencode.h"
4344 #include "util/data/msgreply.h"
4445 #include "util/data/msgparse.h"
3636 * Routines for message parsing a packet buffer to a descriptive structure.
3737 */
3838 #include "config.h"
39 #include "ldns/ldns.h"
3940 #include "util/data/msgparse.h"
4041 #include "util/net_help.h"
4142 #include "util/data/dname.h"
6262 #ifndef UTIL_DATA_MSGPARSE_H
6363 #define UTIL_DATA_MSGPARSE_H
6464 #include "util/storage/lruhash.h"
65 #include "ldns/packet.h"
6566 struct rrset_parse;
6667 struct rr_parse;
6768 struct regional;
3939 */
4040
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "util/data/msgreply.h"
4344 #include "util/storage/lookup3.h"
4445 #include "util/log.h"
3939 */
4040
4141 #include "config.h"
42 #include "ldns/wire2host.h"
4243 #include "util/data/packed_rrset.h"
4344 #include "util/data/dname.h"
4445 #include "util/storage/lookup3.h"
4141 #ifndef UTIL_DATA_PACKED_RRSET_H
4242 #define UTIL_DATA_PACKED_RRSET_H
4343 #include "util/storage/lruhash.h"
44 #include "ldns/rr.h"
4445 struct alloc_cache;
4546 struct regional;
4647
254254 return 0;
255255 }
256256
257 /** whitelist env->send_query callbacks */
257258 int
258259 fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)(
259260 uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
260 uint16_t flags, int dnssec, struct sockaddr_storage* addr,
261 socklen_t addrlen, struct module_qstate* q))
261 uint16_t flags, int dnssec, int want_dnssec,
262 struct sockaddr_storage* addr, socklen_t addrlen,
263 struct module_qstate* q))
262264 {
263265 if(fptr == &worker_send_query) return 1;
264266 else if(fptr == &libworker_send_query) return 1;
200200 */
201201 int fptr_whitelist_modenv_send_query(struct outbound_entry* (*fptr)(
202202 uint8_t* qname, size_t qnamelen, uint16_t qtype, uint16_t qclass,
203 uint16_t flags, int dnssec, struct sockaddr_storage* addr,
204 socklen_t addrlen, struct module_qstate* q));
203 uint16_t flags, int dnssec, int want_dnssec,
204 struct sockaddr_storage* addr, socklen_t addrlen,
205 struct module_qstate* q));
205206
206207 /**
207208 * Check function pointer whitelist for module_env detach_subs callback values.
39803980 4869,
39813981 4870,
39823982 4871,
3983 4881,
3984 4882,
39833985 4884,
39843986 4885,
39853987 4894,
41164118 5265,
41174119 5269,
41184120 5270,
4121 5271,
41194122 5272,
41204123 5282,
41214124 5298,
41914194 5433,
41924195 5434,
41934196 5435,
4197 5436,
4198 5437,
41944199 5443,
41954200 5453,
41964201 5454,
42624267 5722,
42634268 5723,
42644269 5724,
4270 5728,
42654271 5729,
42664272 5730,
42674273 5741,
50425048 17007,
50435049 17185,
50445050 17219,
5051 17234,
50455052 17235,
50465053 17500,
50475054 17729,
4040
4141 #ifndef UTIL_LOG_H
4242 #define UTIL_LOG_H
43 #include "ldns/buffer.h"
4344
4445 /**
4546 * verbosity value:
4040 */
4141
4242 #include "config.h"
43 #ifdef HAVE_TIME_H
44 #include <time.h>
45 #endif
46 #include <sys/time.h>
4347
4448 #if defined(USE_MINI_EVENT) && !defined(USE_WINSOCK)
4549 #include <signal.h>
113113 * @param dnssec: if set, EDNS record will have bits set.
114114 * If EDNS_DO bit is set, DO bit is set in EDNS records.
115115 * If BIT_CD is set, CD bit is set in queries with EDNS records.
116 * @param want_dnssec: if set, the validator wants DNSSEC. Without
117 * EDNS, the answer is likely to be useless for this domain.
116118 * @param addr: where to.
117119 * @param addrlen: length of addr.
118120 * @param q: wich query state to reactivate upon return.
123125 */
124126 struct outbound_entry* (*send_query)(uint8_t* qname, size_t qnamelen,
125127 uint16_t qtype, uint16_t qclass, uint16_t flags, int dnssec,
126 struct sockaddr_storage* addr, socklen_t addrlen,
127 struct module_qstate* q);
128 int want_dnssec, struct sockaddr_storage* addr,
129 socklen_t addrlen, struct module_qstate* q);
128130
129131 /**
130132 * Detach-subqueries.
3737 */
3838
3939 #include "config.h"
40 #include "ldns/ldns.h"
4041 #include "util/net_help.h"
4142 #include "util/log.h"
4243 #include "util/data/dname.h"
3838 * This file contains event notification functions.
3939 */
4040 #include "config.h"
41 #include "ldns/wire2host.h"
4142 #include "util/netevent.h"
4243 #include "util/log.h"
4344 #include "util/net_help.h"
4445 #include "util/fptr_wlist.h"
4546
4647 /* -------- Start of local definitions -------- */
48 /** if CMSG_ALIGN is not defined on this platform, a workaround */
49 #ifndef CMSG_ALIGN
50 # ifdef _CMSG_DATA_ALIGN
51 # define CMSG_ALIGN _CMSG_DATA_ALIGN
52 # else
53 # define CMSG_ALIGN(len) (((len)+sizeof(long)-1) & ~(sizeof(long)-1))
54 # endif
55 #endif
56
57 /** if CMSG_LEN is not defined on this platform, a workaround */
58 #ifndef CMSG_LEN
59 # define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr))+(len))
60 #endif
61
62 /** if CMSG_SPACE is not defined on this platform, a workaround */
63 #ifndef CMSG_SPACE
64 # ifdef _CMSG_HDR_ALIGN
65 # define CMSG_SPACE(l) (CMSG_ALIGN(l)+_CMSG_HDR_ALIGN(sizeof(struct cmsghdr)))
66 # else
67 # define CMSG_SPACE(l) (CMSG_ALIGN(l)+CMSG_ALIGN(sizeof(struct cmsghdr)))
68 # endif
69 #endif
70
4771 /** The TCP reading or writing query timeout in seconds */
4872 #define TCP_QUERY_TIMEOUT 120
4973
293317 return 1;
294318 }
295319
296 /** if no CMSG_LEN (Solaris 9) define something reasonable for one element */
297 #ifndef CMSG_LEN
298 #define CMSG_LEN(x) (sizeof(struct cmsghdr)+(x))
299 #endif
300
301320 /** print debug ancillary info */
302321 void p_ancil(const char* str, struct comm_reply* r)
303322 {
315334 buf[sizeof(buf)-1]=0;
316335 log_info("%s: %s %d", str, buf, r->pktinfo.v6info.ipi6_ifindex);
317336 } else if(r->srctype == 4) {
318 #ifdef IP_RECVDSTADDR
337 #ifdef IP_PKTINFO
338 char buf1[1024], buf2[1024];
339 if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_addr,
340 buf1, (socklen_t)sizeof(buf1)) == 0) {
341 strncpy(buf1, "(inet_ntop error)", sizeof(buf1));
342 }
343 buf1[sizeof(buf1)-1]=0;
344 if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_spec_dst,
345 buf2, (socklen_t)sizeof(buf2)) == 0) {
346 strncpy(buf2, "(inet_ntop error)", sizeof(buf2));
347 }
348 buf2[sizeof(buf2)-1]=0;
349 log_info("%s: %d %s %s", str, r->pktinfo.v4info.ipi_ifindex,
350 buf1, buf2);
351 #elif defined(IP_RECVDSTADDR)
319352 char buf1[1024];
320353 if(inet_ntop(AF_INET, &r->pktinfo.v4addr,
321354 buf1, (socklen_t)sizeof(buf1)) == 0) {
323356 }
324357 buf1[sizeof(buf1)-1]=0;
325358 log_info("%s: %s", str, buf1);
326 #elif defined(IP_PKTINFO)
327 char buf1[1024], buf2[1024];
328 if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_addr,
329 buf1, (socklen_t)sizeof(buf1)) == 0) {
330 strncpy(buf1, "(inet_ntop error)", sizeof(buf1));
331 }
332 buf1[sizeof(buf1)-1]=0;
333 if(inet_ntop(AF_INET, &r->pktinfo.v4info.ipi_spec_dst,
334 buf2, (socklen_t)sizeof(buf2)) == 0) {
335 strncpy(buf2, "(inet_ntop error)", sizeof(buf2));
336 }
337 buf2[sizeof(buf2)-1]=0;
338 log_info("%s: %d %s %s", str, r->pktinfo.v4info.ipi_ifindex,
339 buf1, buf2);
340359 #endif
341360 }
342361 #else
378397 #ifndef S_SPLINT_S
379398 cmsg = CMSG_FIRSTHDR(&msg);
380399 if(r->srctype == 4) {
381 #ifdef IP_RECVDSTADDR
382 cmsg->cmsg_level = IPPROTO_IP;
383 cmsg->cmsg_type = IP_RECVDSTADDR;
384 memmove(CMSG_DATA(cmsg), &r->pktinfo.v4addr,
385 sizeof(struct in_addr));
386 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
387 #elif defined(IP_PKTINFO)
400 #ifdef IP_PKTINFO
401 msg.msg_controllen = CMSG_SPACE(sizeof(struct in_pktinfo));
402 log_assert(msg.msg_controllen <= sizeof(control));
388403 cmsg->cmsg_level = IPPROTO_IP;
389404 cmsg->cmsg_type = IP_PKTINFO;
390405 memmove(CMSG_DATA(cmsg), &r->pktinfo.v4info,
391406 sizeof(struct in_pktinfo));
392407 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
408 #elif defined(IP_SENDSRCADDR)
409 msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr));
410 log_assert(msg.msg_controllen <= sizeof(control));
411 cmsg->cmsg_level = IPPROTO_IP;
412 cmsg->cmsg_type = IP_SENDSRCADDR;
413 memmove(CMSG_DATA(cmsg), &r->pktinfo.v4addr,
414 sizeof(struct in_addr));
415 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
416 #else
417 verbose(VERB_ALGO, "no IP_PKTINFO or IP_SENDSRCADDR");
418 msg.msg_control = NULL;
393419 #endif
394420 } else if(r->srctype == 6) {
421 msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
422 log_assert(msg.msg_controllen <= sizeof(control));
395423 cmsg->cmsg_level = IPPROTO_IPV6;
396424 cmsg->cmsg_type = IPV6_PKTINFO;
397425 memmove(CMSG_DATA(cmsg), &r->pktinfo.v6info,
399427 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
400428 } else {
401429 /* try to pass all 0 to use default route */
430 msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
431 log_assert(msg.msg_controllen <= sizeof(control));
402432 cmsg->cmsg_level = IPPROTO_IPV6;
403433 cmsg->cmsg_type = IPV6_PKTINFO;
404434 memset(CMSG_DATA(cmsg), 0, sizeof(struct in6_pktinfo));
405435 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
406436 }
407 msg.msg_controllen = cmsg->cmsg_len;
408437 #endif /* S_SPLINT_S */
409
410438 if(verbosity >= VERB_ALGO)
411439 p_ancil("send_udp over interface", r);
412440 sent = sendmsg(c->fd, &msg, 0);
489517 memmove(&rep.pktinfo.v6info, CMSG_DATA(cmsg),
490518 sizeof(struct in6_pktinfo));
491519 break;
492 #ifdef IP_RECVDSTADDR
520 #ifdef IP_PKTINFO
521 } else if( cmsg->cmsg_level == IPPROTO_IP &&
522 cmsg->cmsg_type == IP_PKTINFO) {
523 rep.srctype = 4;
524 memmove(&rep.pktinfo.v4info, CMSG_DATA(cmsg),
525 sizeof(struct in_pktinfo));
526 break;
527 #elif defined(IP_RECVDSTADDR)
493528 } else if( cmsg->cmsg_level == IPPROTO_IP &&
494529 cmsg->cmsg_type == IP_RECVDSTADDR) {
495530 rep.srctype = 4;
496531 memmove(&rep.pktinfo.v4addr, CMSG_DATA(cmsg),
497532 sizeof(struct in_addr));
498 break;
499 #elif defined(IP_PKTINFO)
500 } else if( cmsg->cmsg_level == IPPROTO_IP &&
501 cmsg->cmsg_type == IP_PKTINFO) {
502 rep.srctype = 4;
503 memmove(&rep.pktinfo.v4info, CMSG_DATA(cmsg),
504 sizeof(struct in_pktinfo));
505533 break;
506534 #endif
507535 }
5959 #ifndef NET_EVENT_H
6060 #define NET_EVENT_H
6161
62 #include "ldns/buffer.h"
6263 struct comm_point;
6364 struct comm_reply;
6465 struct event_base;
106107 #ifdef IPV6_PKTINFO
107108 struct in6_pktinfo v6info;
108109 #endif
109 #ifdef IP_RECVDSTADDR
110 #ifdef IP_PKTINFO
111 struct in_pktinfo v4info;
112 #elif defined(IP_RECVDSTADDR)
110113 struct in_addr v4addr;
111 #elif defined(IP_PKTINFO)
112 struct in_pktinfo v4info;
113114 #endif
114115 }
115116 /** variable with return source data */
176176 return (long int)((r) % (((unsigned)MAX_VALUE + 1)));
177177 }
178178
179 long int
180 ub_random_max(struct ub_randstate* state, long int x)
181 {
182 /* make sure we fetch in a range that is divisible by x. ignore
183 * values from d .. MAX_VALUE, instead draw a new number */
184 long int d = MAX_VALUE - (MAX_VALUE % x); /* d is divisible by x */
185 long int v = ub_random(state);
186 while(d <= v)
187 v = ub_random(state);
188 return (v % x);
189 }
190
179191 void
180192 ub_randfree(struct ub_randstate* s)
181193 {
7575 long int ub_random(struct ub_randstate* state);
7676
7777 /**
78 * Generate random number between 0 and x-1. No modulo bias.
79 * @param state: must have been initialised with ub_initstate.
80 * @param x: an upper limit. not (negative or zero). must be smaller than 2**31.
81 * @return: random value between 0..x-1. Possibly more than one
82 * random number is picked from the random stream to satisfy this.
83 */
84 long int ub_random_max(struct ub_randstate* state, long int x);
85
86 /**
7887 * Delete the random state.
7988 * @param state: to delete.
8089 */
3838 * This file contains functions to make a histogram of time values.
3939 */
4040 #include "config.h"
41 #ifdef HAVE_TIME_H
42 #include <time.h>
43 #endif
44 #include <sys/time.h>
4145 #include "util/timehist.h"
4246 #include "util/log.h"
4347
4040 * It was modified to fit into unbound. The state table process is the same.
4141 */
4242 #include "config.h"
43 #include "ldns/ldns.h"
4344 #include "validator/autotrust.h"
4445 #include "validator/val_anchor.h"
4546 #include "validator/val_utils.h"
16831684 wait = 3600;
16841685 rnd = wait/10;
16851686 rest = wait-rnd;
1686 rnd = (uint32_t)ub_random(env->rnd) % rnd;
1687 rnd = (uint32_t)ub_random_max(env->rnd, (long int)rnd);
16871688 return (time_t)(*env->now + rest + rnd);
16881689 }
16891690
3838 * This file contains storage for the trust anchors for the validator.
3939 */
4040 #include "config.h"
41 #include <ctype.h>
42 #include "ldns/dname.h"
43 #include "ldns/host2wire.h"
4144 #include "validator/val_anchor.h"
4245 #include "validator/val_sigcrypt.h"
4346 #include "validator/autotrust.h"
3838 * This file contains functions for dealing with validator key entries.
3939 */
4040 #include "config.h"
41 #include "ldns/ldns.h"
4142 #include "validator/val_kentry.h"
4243 #include "util/data/packed_rrset.h"
4344 #include "util/data/dname.h"
4141 * from cached NSEC records.
4242 */
4343 #include "config.h"
44 #ifdef HAVE_OPENSSL_SSL_H
45 #include "openssl/ssl.h"
46 #endif
4447 #include "validator/val_neg.h"
4548 #include "validator/val_nsec.h"
4649 #include "validator/val_nsec3.h"
4040 * for denial of existance, and proofs for presence of types.
4141 */
4242 #include "config.h"
43 #include "ldns/packet.h"
4344 #include "validator/val_nsec.h"
4445 #include "validator/val_utils.h"
4546 #include "util/data/msgreply.h"
4647 #include "util/data/dname.h"
4748 #include "util/net_help.h"
49 #include "util/module.h"
50 #include "services/cache/rrset.h"
4851
4952 /** get ttl of rrset */
5053 static uint32_t
169172 return sec_status_secure;
170173 }
171174
175 /** check security status from cache or verify rrset, returns true if secure */
176 static int
177 nsec_verify_rrset(struct module_env* env, struct val_env* ve,
178 struct ub_packed_rrset_key* nsec, struct key_entry_key* kkey,
179 char** reason)
180 {
181 struct packed_rrset_data* d = (struct packed_rrset_data*)
182 nsec->entry.data;
183 if(d->security == sec_status_secure)
184 return 1;
185 rrset_check_sec_status(env->rrset_cache, nsec, *env->now);
186 if(d->security == sec_status_secure)
187 return 1;
188 d->security = val_verify_rrset_entry(env, ve, nsec, kkey, reason);
189 if(d->security == sec_status_secure) {
190 rrset_update_sec_status(env->rrset_cache, nsec, *env->now);
191 return 1;
192 }
193 return 0;
194 }
195
172196 enum sec_status
173197 val_nsec_prove_nodata_dsreply(struct module_env* env, struct val_env* ve,
174198 struct query_info* qinfo, struct reply_info* rep,
189213 * 1) this is a delegation point and there is no DS
190214 * 2) this is not a delegation point */
191215 if(nsec) {
192 sec = val_verify_rrset_entry(env, ve, nsec, kkey, reason);
193 if(sec != sec_status_secure) {
216 if(!nsec_verify_rrset(env, ve, nsec, kkey, reason)) {
194217 verbose(VERB_ALGO, "NSEC RRset for the "
195218 "referral did not verify.");
196219 return sec_status_bogus;
219242 i++) {
220243 if(rep->rrsets[i]->rk.type != htons(LDNS_RR_TYPE_NSEC))
221244 continue;
222 sec = val_verify_rrset_entry(env, ve, rep->rrsets[i], kkey,
223 reason);
224 if(sec != sec_status_secure) {
245 if(!nsec_verify_rrset(env, ve, rep->rrsets[i], kkey, reason)) {
225246 verbose(VERB_ALGO, "NSEC for empty non-terminal "
226247 "did not verify.");
227248 return sec_status_bogus;
4040 * for denial of existance, and proofs for presence of types.
4141 */
4242 #include "config.h"
43 #include <ctype.h>
44 #ifdef HAVE_OPENSSL_SSL_H
45 #include "openssl/ssl.h"
46 #endif
4347 #include "validator/val_nsec3.h"
4448 #include "validator/validator.h"
4549 #include "validator/val_kentry.h"
50 #include "services/cache/rrset.h"
4651 #include "util/regional.h"
4752 #include "util/rbtree.h"
4853 #include "util/module.h"
418423 if(!nsec3_rrset_has_known(list[i]))
419424 continue;
420425
421 /* since NSECs are base32.zonename, we can find the zone
426 /* since NSEC3s are base32.zonename, we can find the zone
422427 * name by stripping off the first label of the record */
423428 nm = list[i]->rk.dname;
424429 nmlen = list[i]->rk.dname_len;
12461251 struct ub_packed_rrset_key** list, size_t num,
12471252 struct key_entry_key* kkey, char** reason)
12481253 {
1254 struct packed_rrset_data* d;
12491255 size_t i;
1250 enum sec_status sec;
12511256 for(i=0; i<num; i++) {
1257 d = (struct packed_rrset_data*)list[i]->entry.data;
12521258 if(list[i]->rk.type != htons(LDNS_RR_TYPE_NSEC3))
12531259 continue;
1254 sec = val_verify_rrset_entry(env, ve, list[i], kkey, reason);
1255 if(sec != sec_status_secure) {
1260 if(d->security == sec_status_secure)
1261 continue;
1262 rrset_check_sec_status(env->rrset_cache, list[i], *env->now);
1263 if(d->security == sec_status_secure)
1264 continue;
1265 d->security = val_verify_rrset_entry(env, ve, list[i], kkey,
1266 reason);
1267 if(d->security != sec_status_secure) {
12561268 verbose(VERB_ALGO, "NSEC3 did not verify");
12571269 return 0;
12581270 }
1271 rrset_update_sec_status(env->rrset_cache, list[i], *env->now);
12591272 }
12601273 return 1;
12611274 }
4040 * bridging between RR wireformat data and crypto calls.
4141 */
4242 #include "config.h"
43 #include "ldns/ldns.h"
4344 #include "validator/val_sigcrypt.h"
4445 #include "validator/validator.h"
4546 #include "util/data/msgreply.h"
5455 #error "Need SSL library to do digital signature cryptography"
5556 #endif
5657
58 #ifdef HAVE_OPENSSL_ERR_H
59 #include <openssl/err.h>
60 #endif
61
62 #ifdef HAVE_OPENSSL_RAND_H
63 #include <openssl/rand.h>
64 #endif
65
66 #ifdef HAVE_OPENSSL_CONF_H
67 #include <openssl/conf.h>
68 #endif
69
70 #ifdef HAVE_OPENSSL_ENGINE_H
71 #include <openssl/engine.h>
72 #endif
73
5774 /** return number of rrs in an rrset */
5875 static size_t
5976 rrset_get_count(struct ub_packed_rrset_key* rrset)
256273 return SHA256_DIGEST_LENGTH;
257274 #endif
258275 #ifdef USE_GOST
259 case LDNS_HASH_GOST94:
276 case LDNS_HASH_GOST:
260277 if(EVP_get_digestbyname("md_gost94"))
261278 return 32;
262279 else return 0;
267284 }
268285
269286 #ifdef USE_GOST
270 /** Perform GOST94 hash */
287 /** Perform GOST hash */
271288 static int
272289 do_gost94(unsigned char* data, size_t len, unsigned char* dest)
273290 {
324341 return 1;
325342 #endif
326343 #ifdef USE_GOST
327 case LDNS_HASH_GOST94:
344 case LDNS_HASH_GOST:
328345 if(do_gost94((unsigned char*)ldns_buffer_begin(b),
329346 ldns_buffer_limit(b), (unsigned char*)digest))
330347 return 1;
401418 #endif
402419 return 1;
403420 #ifdef USE_GOST
404 case LDNS_GOST:
421 case LDNS_ECC_GOST:
405422 /* we support GOST if it can be loaded */
406423 return ldns_key_EVP_load_gost_id();
407424 #endif
13651382
13661383 break;
13671384 #ifdef USE_GOST
1368 case LDNS_GOST:
1385 case LDNS_ECC_GOST:
13691386 *evp_key = ldns_gost2pkey_raw(key, keylen);
13701387 if(!*evp_key) {
13711388 verbose(VERB_QUERY, "verify: "
557557 entry.data;
558558 uint8_t labcount;
559559 int labdiff;
560 size_t i;
560 uint8_t* wn;
561 size_t i, wl;
561562 if(d->rrsig_count == 0) {
562563 return 1;
563564 }
572573 /* if the RRSIG label count is shorter than the number of actual
573574 * labels, then this rrset was synthesized from a wildcard.
574575 * Note that the RRSIG label count doesn't count the root label. */
575 labdiff = (dname_count_labels(rrset->rk.dname) - 1) - (int)labcount;
576 wn = rrset->rk.dname;
577 wl = rrset->rk.dname_len;
578 /* skip a leading wildcard label in the dname (RFC4035 2.2) */
579 if(dname_is_wild(wn)) {
580 wn += 2;
581 wl -= 2;
582 }
583 labdiff = (dname_count_labels(wn) - 1) - (int)labcount;
576584 if(labdiff > 0) {
577 size_t wl = rrset->rk.dname_len;
578 *wc = rrset->rk.dname;
585 *wc = wn;
579586 dname_remove_labels(wc, &wl, labdiff);
580587 return 1;
581588 }
3939 * According to RFC 4034.
4040 */
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "validator/validator.h"
4344 #include "validator/val_anchor.h"
4445 #include "validator/val_kcache.h"
14191420 vq->empty_DS_name) == 0) {
14201421 /* do not query for empty_DS_name again */
14211422 verbose(VERB_ALGO, "Cannot retrieve DS for signature");
1423 errinf(qstate, "no signatures");
1424 errinf_origin(qstate, qstate->reply_origin);
14221425 vq->chase_reply->security = sec_status_bogus;
14231426 vq->state = VAL_FINISHED_STATE;
14241427 return 1;
24512454 "bogus", val_classification_to_string(subtype));
24522455 errinf(qstate, "no DS but also no proof of that");
24532456 goto return_bogus;
2457 } else if(subtype == VAL_CLASS_CNAME ||
2458 subtype == VAL_CLASS_CNAMENOANSWER) {
2459 /* if the CNAME matches the exact name we want and is signed
2460 * properly, then also, we are sure that no DS exists there,
2461 * much like a NODATA proof */
2462 enum sec_status sec;
2463 struct ub_packed_rrset_key* cname;
2464 cname = reply_find_rrset_section_an(msg->rep, qinfo->qname,
2465 qinfo->qname_len, LDNS_RR_TYPE_CNAME, qinfo->qclass);
2466 if(!cname) {
2467 errinf(qstate, "validator classified CNAME but no "
2468 "CNAME of the queried name for DS");
2469 goto return_bogus;
2470 }
2471 if(((struct packed_rrset_data*)cname->entry.data)->rrsig_count
2472 == 0) {
2473 if(msg->rep->an_numrrsets != 0 && ntohs(msg->rep->
2474 rrsets[0]->rk.type)==LDNS_RR_TYPE_DNAME) {
2475 errinf(qstate, "DS got DNAME answer");
2476 } else {
2477 errinf(qstate, "DS got unsigned CNAME answer");
2478 }
2479 goto return_bogus;
2480 }
2481 sec = val_verify_rrset_entry(qstate->env, ve, cname,
2482 vq->key_entry, &reason);
2483 if(sec == sec_status_secure) {
2484 verbose(VERB_ALGO, "CNAME validated, "
2485 "proof that DS does not exist");
2486 /* and that it is not a referral point */
2487 *ke = NULL;
2488 return 1;
2489 }
2490 errinf(qstate, "CNAME in DS response was not secure.");
2491 errinf(qstate, reason);
2492 goto return_bogus;
24542493 } else {
24552494 verbose(VERB_QUERY, "Encountered an unhandled type of "
24562495 "DS response, thus bogus.");
2457 errinf(qstate, "no DS and ");
2496 errinf(qstate, "no DS and");
24582497 if(FLAGS_GET_RCODE(msg->rep->flags) != LDNS_RCODE_NOERROR) {
24592498 char* rc = ldns_pkt_rcode2str(
24602499 FLAGS_GET_RCODE(msg->rep->flags));
3939 * windows (no shell).
4040 */
4141 #include "config.h"
42 #include "ldns/ldns.h"
4243 #include "libunbound/unbound.h"
4344
4445 /** usage */