Codebase list unbound / 27a1281
Imported Debian patch 1.4.3-1 Robert S. Edmonds 12 years ago
24 changed file(s) with 460 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
418418
419419 /* default username */
420420 #undef UB_USERNAME
421
422 /* use to enable lightweight alloc assertions, for debug use */
423 #undef UNBOUND_ALLOC_LITE
424
425 /* use malloc not regions, for debug use */
426 #undef UNBOUND_ALLOC_NONREGIONAL
421427
422428 /* use statistics for allocs and frees, for debug use */
423429 #undef UNBOUND_ALLOC_STATS
831837 const char* func);
832838 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
833839 int line, const char* func);
834 #endif /* UNBOUND_ALLOC_STATS */
840 #elif defined(UNBOUND_ALLOC_LITE)
841 # include "util/alloc.h"
842 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
835843
836844 /** default port for DNS traffic. */
837845 #define UNBOUND_DNS_PORT 53
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.63 for unbound 1.4.2.
2 # Generated by GNU Autoconf 2.63 for unbound 1.4.3.
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.2'
748 PACKAGE_STRING='unbound 1.4.2'
747 PACKAGE_VERSION='1.4.3'
748 PACKAGE_STRING='unbound 1.4.3'
749749 PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl'
750750
751751 # Factoring default headers for most tests.
931931 enable_staticexe
932932 enable_lock_checks
933933 enable_alloc_checks
934 enable_alloc_lite
935 enable_alloc_nonregional
934936 enable_largefile
935937 with_ldns
936938 with_ldns_builtin
14991501 # Omit some internal or obsolete options to make the list less imposing.
15001502 # This message is too long to be a string in the A/UX 3.1 sh.
15011503 cat <<_ACEOF
1502 \`configure' configures unbound 1.4.2 to adapt to many kinds of systems.
1504 \`configure' configures unbound 1.4.3 to adapt to many kinds of systems.
15031505
15041506 Usage: $0 [OPTION]... [VAR=VALUE]...
15051507
15641566
15651567 if test -n "$ac_init_help"; then
15661568 case $ac_init_help in
1567 short | recursive ) echo "Configuration of unbound 1.4.2:";;
1569 short | recursive ) echo "Configuration of unbound 1.4.3:";;
15681570 esac
15691571 cat <<\_ACEOF
15701572
15861588 event, ldns libs, for debug purposes
15871589 --enable-lock-checks enable to check lock and unlock calls, for debug
15881590 purposes
1589 --enable-alloc-checks enable to check memory allocation, for debug
1591 --enable-alloc-checks enable to memory allocation statistics, for debug
1592 purposes
1593 --enable-alloc-lite enable for lightweight alloc assertions, for debug
1594 purposes
1595 --enable-alloc-nonregional
1596 enable nonregional allocs, slow but exposes regional
1597 allocations to other memory purifiers, for debug
15901598 purposes
15911599 --disable-largefile omit support for large files
15921600
17101718 test -n "$ac_init_help" && exit $ac_status
17111719 if $ac_init_version; then
17121720 cat <<\_ACEOF
1713 unbound configure 1.4.2
1721 unbound configure 1.4.3
17141722 generated by GNU Autoconf 2.63
17151723
17161724 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
17241732 This file contains any messages produced by compilers while
17251733 running configure, to aid debugging if configure makes a mistake.
17261734
1727 It was created by unbound $as_me 1.4.2, which was
1735 It was created by unbound $as_me 1.4.3, which was
17281736 generated by GNU Autoconf 2.63. Invocation command line was
17291737
17301738 $ $0 $@
20942102
20952103
20962104 LIBUNBOUND_CURRENT=2
2097 LIBUNBOUND_REVISION=2
2105 LIBUNBOUND_REVISION=3
20982106 LIBUNBOUND_AGE=0
20992107 # 1.0.0 had 0:12:0
21002108 # 1.0.1 had 0:13:0
21122120 # 1.4.0 had 1:5:0 (not 2:0:0) # ub_result.why_bogus
21132121 # 1.4.1 had 2:1:0
21142122 # 1.4.2 had 2:2:0
2123 # 1.4.3 had 2:3:0
21152124
21162125 # Current -- the number of the binary API that we're implementing
21172126 # Revision -- which iteration of the implementation of the binary
72887297 else
72897298 lt_cv_nm_interface="BSD nm"
72907299 echo "int some_variable = 0;" > conftest.$ac_ext
7291 (eval echo "\"\$as_me:7292: $ac_compile\"" >&5)
7300 (eval echo "\"\$as_me:7301: $ac_compile\"" >&5)
72927301 (eval "$ac_compile" 2>conftest.err)
72937302 cat conftest.err >&5
7294 (eval echo "\"\$as_me:7295: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
7303 (eval echo "\"\$as_me:7304: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
72957304 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
72967305 cat conftest.err >&5
7297 (eval echo "\"\$as_me:7298: output\"" >&5)
7306 (eval echo "\"\$as_me:7307: output\"" >&5)
72987307 cat conftest.out >&5
72997308 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
73007309 lt_cv_nm_interface="MS dumpbin"
84998508 ;;
85008509 *-*-irix6*)
85018510 # Find out which ABI we are using.
8502 echo '#line 8503 "configure"' > conftest.$ac_ext
8511 echo '#line 8512 "configure"' > conftest.$ac_ext
85038512 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
85048513 (eval $ac_compile) 2>&5
85058514 ac_status=$?
98669875 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
98679876 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
98689877 -e 's:$: $lt_compiler_flag:'`
9869 (eval echo "\"\$as_me:9870: $lt_compile\"" >&5)
9878 (eval echo "\"\$as_me:9879: $lt_compile\"" >&5)
98709879 (eval "$lt_compile" 2>conftest.err)
98719880 ac_status=$?
98729881 cat conftest.err >&5
9873 echo "$as_me:9874: \$? = $ac_status" >&5
9882 echo "$as_me:9883: \$? = $ac_status" >&5
98749883 if (exit $ac_status) && test -s "$ac_outfile"; then
98759884 # The compiler can only warn and ignore the option if not recognized
98769885 # So say no if there are warnings other than the usual output.
1020510214 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1020610215 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1020710216 -e 's:$: $lt_compiler_flag:'`
10208 (eval echo "\"\$as_me:10209: $lt_compile\"" >&5)
10217 (eval echo "\"\$as_me:10218: $lt_compile\"" >&5)
1020910218 (eval "$lt_compile" 2>conftest.err)
1021010219 ac_status=$?
1021110220 cat conftest.err >&5
10212 echo "$as_me:10213: \$? = $ac_status" >&5
10221 echo "$as_me:10222: \$? = $ac_status" >&5
1021310222 if (exit $ac_status) && test -s "$ac_outfile"; then
1021410223 # The compiler can only warn and ignore the option if not recognized
1021510224 # So say no if there are warnings other than the usual output.
1031010319 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1031110320 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1031210321 -e 's:$: $lt_compiler_flag:'`
10313 (eval echo "\"\$as_me:10314: $lt_compile\"" >&5)
10322 (eval echo "\"\$as_me:10323: $lt_compile\"" >&5)
1031410323 (eval "$lt_compile" 2>out/conftest.err)
1031510324 ac_status=$?
1031610325 cat out/conftest.err >&5
10317 echo "$as_me:10318: \$? = $ac_status" >&5
10326 echo "$as_me:10327: \$? = $ac_status" >&5
1031810327 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1031910328 then
1032010329 # The compiler can only warn and ignore the option if not recognized
1036510374 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1036610375 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1036710376 -e 's:$: $lt_compiler_flag:'`
10368 (eval echo "\"\$as_me:10369: $lt_compile\"" >&5)
10377 (eval echo "\"\$as_me:10378: $lt_compile\"" >&5)
1036910378 (eval "$lt_compile" 2>out/conftest.err)
1037010379 ac_status=$?
1037110380 cat out/conftest.err >&5
10372 echo "$as_me:10373: \$? = $ac_status" >&5
10381 echo "$as_me:10382: \$? = $ac_status" >&5
1037310382 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1037410383 then
1037510384 # The compiler can only warn and ignore the option if not recognized
1316813177 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1316913178 lt_status=$lt_dlunknown
1317013179 cat > conftest.$ac_ext <<_LT_EOF
13171 #line 13172 "configure"
13180 #line 13181 "configure"
1317213181 #include "confdefs.h"
1317313182
1317413183 #if HAVE_DLFCN_H
1326413273 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1326513274 lt_status=$lt_dlunknown
1326613275 cat > conftest.$ac_ext <<_LT_EOF
13267 #line 13268 "configure"
13276 #line 13277 "configure"
1326813277 #include "confdefs.h"
1326913278
1327013279 #if HAVE_DLFCN_H
1926319272 enableval=$enable_alloc_checks;
1926419273 fi
1926519274
19275 # Check whether --enable-alloc-lite was given.
19276 if test "${enable_alloc_lite+set}" = set; then
19277 enableval=$enable_alloc_lite;
19278 fi
19279
19280 # Check whether --enable-alloc-nonregional was given.
19281 if test "${enable_alloc_nonregional+set}" = set; then
19282 enableval=$enable_alloc_nonregional;
19283 fi
19284
19285 if test x_$enable_alloc_nonregional = x_yes; then
19286
19287 cat >>confdefs.h <<\_ACEOF
19288 #define UNBOUND_ALLOC_NONREGIONAL 1
19289 _ACEOF
19290
19291 fi
1926619292 if test x_$enable_alloc_checks = x_yes; then
1926719293
1926819294 cat >>confdefs.h <<\_ACEOF
1927019296 _ACEOF
1927119297
1927219298 else
19299 if test x_$enable_alloc_lite = x_yes; then
19300
19301 cat >>confdefs.h <<\_ACEOF
19302 #define UNBOUND_ALLOC_LITE 1
19303 _ACEOF
19304
19305 else
1927319306
1927419307
1927519308 for ac_header in stdlib.h
1952319556
1952419557 fi
1952519558
19559 fi
1952619560 fi
1952719561
1952819562
2287022904
2287122905 fi
2287222906
22907 { $as_echo "$as_me:$LINENO: checking for ldns_key_buf2rsa_raw" >&5
22908 $as_echo_n "checking for ldns_key_buf2rsa_raw... " >&6; }
22909 if test "${ac_cv_func_ldns_key_buf2rsa_raw+set}" = set; then
22910 $as_echo_n "(cached) " >&6
22911 else
22912 cat >conftest.$ac_ext <<_ACEOF
22913 /* confdefs.h. */
22914 _ACEOF
22915 cat confdefs.h >>conftest.$ac_ext
22916 cat >>conftest.$ac_ext <<_ACEOF
22917 /* end confdefs.h. */
22918 /* Define ldns_key_buf2rsa_raw to an innocuous variant, in case <limits.h> declares ldns_key_buf2rsa_raw.
22919 For example, HP-UX 11i <limits.h> declares gettimeofday. */
22920 #define ldns_key_buf2rsa_raw innocuous_ldns_key_buf2rsa_raw
22921
22922 /* System header to define __stub macros and hopefully few prototypes,
22923 which can conflict with char ldns_key_buf2rsa_raw (); below.
22924 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
22925 <limits.h> exists even on freestanding compilers. */
22926
22927 #ifdef __STDC__
22928 # include <limits.h>
22929 #else
22930 # include <assert.h>
22931 #endif
22932
22933 #undef ldns_key_buf2rsa_raw
22934
22935 /* Override any GCC internal prototype to avoid an error.
22936 Use char because int might match the return type of a GCC
22937 builtin and then its argument prototype would still apply. */
22938 #ifdef __cplusplus
22939 extern "C"
22940 #endif
22941 char ldns_key_buf2rsa_raw ();
22942 /* The GNU C library defines this for functions which it implements
22943 to always fail with ENOSYS. Some functions are actually named
22944 something starting with __ and the normal name is an alias. */
22945 #if defined __stub_ldns_key_buf2rsa_raw || defined __stub___ldns_key_buf2rsa_raw
22946 choke me
22947 #endif
22948
22949 int
22950 main ()
22951 {
22952 return ldns_key_buf2rsa_raw ();
22953 ;
22954 return 0;
22955 }
22956 _ACEOF
22957 rm -f conftest.$ac_objext conftest$ac_exeext
22958 if { (ac_try="$ac_link"
22959 case "(($ac_try" in
22960 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
22961 *) ac_try_echo=$ac_try;;
22962 esac
22963 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
22964 $as_echo "$ac_try_echo") >&5
22965 (eval "$ac_link") 2>conftest.er1
22966 ac_status=$?
22967 grep -v '^ *+' conftest.er1 >conftest.err
22968 rm -f conftest.er1
22969 cat conftest.err >&5
22970 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
22971 (exit $ac_status); } && {
22972 test -z "$ac_c_werror_flag" ||
22973 test ! -s conftest.err
22974 } && test -s conftest$ac_exeext && {
22975 test "$cross_compiling" = yes ||
22976 $as_test_x conftest$ac_exeext
22977 }; then
22978 ac_cv_func_ldns_key_buf2rsa_raw=yes
22979 else
22980 $as_echo "$as_me: failed program was:" >&5
22981 sed 's/^/| /' conftest.$ac_ext >&5
22982
22983 ac_cv_func_ldns_key_buf2rsa_raw=no
22984 fi
22985
22986 rm -rf conftest.dSYM
22987 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
22988 conftest$ac_exeext conftest.$ac_ext
22989 fi
22990 { $as_echo "$as_me:$LINENO: result: $ac_cv_func_ldns_key_buf2rsa_raw" >&5
22991 $as_echo "$ac_cv_func_ldns_key_buf2rsa_raw" >&6; }
22992
2287322993
2287422994 for ac_header in ldns/ldns.h
2287522995 do
2293323053 done
2293423054
2293523055 if test $ac_cv_lib_ldns_ldns_buffer_copy = yes \
23056 -a $ac_cv_func_ldns_key_buf2rsa_raw = yes \
2293623057 -a $ac_cv_header_ldns_ldns_h = yes; then
2293723058 { $as_echo "$as_me:$LINENO: checking for ldns_b32_ntop_extended_hex" >&5
2293823059 $as_echo_n "checking for ldns_b32_ntop_extended_hex... " >&6; }
2357523696 # report actual input values of CONFIG_FILES etc. instead of their
2357623697 # values after options handling.
2357723698 ac_log="
23578 This file was extended by unbound $as_me 1.4.2, which was
23699 This file was extended by unbound $as_me 1.4.3, which was
2357923700 generated by GNU Autoconf 2.63. Invocation command line was
2358023701
2358123702 CONFIG_FILES = $CONFIG_FILES
2363823759 _ACEOF
2363923760 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2364023761 ac_cs_version="\\
23641 unbound config.status 1.4.2
23762 unbound config.status 1.4.3
2364223763 configured by $0, generated by GNU Autoconf 2.63,
2364323764 with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
2364423765
55 sinclude(acx_python.m4)
66 sinclude(ac_pkg_swig.m4)
77
8 AC_INIT(unbound, 1.4.2, unbound-bugs@nlnetlabs.nl, unbound)
8 AC_INIT(unbound, 1.4.3, unbound-bugs@nlnetlabs.nl, unbound)
99
1010 LIBUNBOUND_CURRENT=2
11 LIBUNBOUND_REVISION=2
11 LIBUNBOUND_REVISION=3
1212 LIBUNBOUND_AGE=0
1313 # 1.0.0 had 0:12:0
1414 # 1.0.1 had 0:13:0
2626 # 1.4.0 had 1:5:0 (not 2:0:0) # ub_result.why_bogus
2727 # 1.4.1 had 2:1:0
2828 # 1.4.2 had 2:2:0
29 # 1.4.3 had 2:3:0
2930
3031 # Current -- the number of the binary API that we're implementing
3132 # Revision -- which iteration of the implementation of the binary
514515
515516 # set memory allocation checking if requested
516517 AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks],
517 [ enable to check memory allocation, for debug purposes ]),
518 [ enable to memory allocation statistics, for debug purposes ]),
518519 , )
520 AC_ARG_ENABLE(alloc-lite, AC_HELP_STRING([--enable-alloc-lite],
521 [ enable for lightweight alloc assertions, for debug purposes ]),
522 , )
523 AC_ARG_ENABLE(alloc-nonregional, AC_HELP_STRING([--enable-alloc-nonregional],
524 [ enable nonregional allocs, slow but exposes regional allocations to other memory purifiers, for debug purposes ]),
525 , )
526 if test x_$enable_alloc_nonregional = x_yes; then
527 AC_DEFINE(UNBOUND_ALLOC_NONREGIONAL, 1, [use malloc not regions, for debug use])
528 fi
519529 if test x_$enable_alloc_checks = x_yes; then
520530 AC_DEFINE(UNBOUND_ALLOC_STATS, 1, [use statistics for allocs and frees, for debug use])
521531 else
522 ACX_FUNC_MALLOC([unbound])
532 if test x_$enable_alloc_lite = x_yes; then
533 AC_DEFINE(UNBOUND_ALLOC_LITE, 1, [use to enable lightweight alloc assertions, for debug use])
534 else
535 ACX_FUNC_MALLOC([unbound])
536 fi
523537 fi
524538
525539 AC_FUNC_CHOWN
593607 # check if ldns is good enough
594608 if test "$use_ldns_builtin" = "no"; then
595609 AC_CHECK_LIB(ldns, ldns_buffer_copy)
610 AC_CHECK_FUNC(ldns_key_buf2rsa_raw)
596611 AC_CHECK_HEADERS([ldns/ldns.h],,, [AC_INCLUDES_DEFAULT])
597612 if test $ac_cv_lib_ldns_ldns_buffer_copy = yes \
613 -a $ac_cv_func_ldns_key_buf2rsa_raw = yes \
598614 -a $ac_cv_header_ldns_ldns_h = yes; then
599615 dnl ldns was found, check compat functions
600616 AC_CHECK_FUNC([ldns_b32_ntop_extended_hex],, [
769785 const char* func);
770786 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
771787 int line, const char* func);
772 #endif /* UNBOUND_ALLOC_STATS */
788 #elif defined(UNBOUND_ALLOC_LITE)
789 # include "util/alloc.h"
790 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
773791
774792 /** default port for DNS traffic. */
775793 #define UNBOUND_DNS_PORT 53
312312 if(daemon(1, 0) != 0)
313313 fatal_exit("daemon failed: %s", strerror(errno));
314314 #else /* no HAVE_DAEMON */
315 #ifdef HAVE_WORKING_FORK
315 #ifdef HAVE_FORK
316316 int fd;
317317 /* Take off... */
318318 switch (fork()) {
336336 if (fd > 2)
337337 (void)close(fd);
338338 }
339 #endif /* HAVE_WORKING_FORK */
339 #endif /* HAVE_FORK */
340340 #endif /* HAVE_DAEMON */
341341 }
342342
0 unbound (1.4.3-1) unstable; urgency=low
1
2 * New upstream release.
3
4 -- Robert S. Edmonds <edmonds@debian.org> Thu, 11 Mar 2010 15:55:33 -0500
5
06 unbound (1.4.2-1) unstable; urgency=low
17
28 * New upstream release.
0 11 March 2010: Wouter
1 - another memory allocation option: --enable-alloc-nonregional.
2 exposes the regional allocations to other memory purifiers.
3 - fix for memory alignment in struct sock_list allocation.
4 - Fix for MacPorts ldns without ssl default, unbound checks if ldns
5 has dnssec functionality and uses the builtin if not.
6 - Fix daemonize on Solaris 10, it did not detach from terminal.
7
8 10 March 2010: Wouter
9 - --enable-alloc-lite works with test set.
10 - portability in the testset: printf format conversions, prototypes.
11
12 9 March 2010: Wouter
13 - tag 1.4.2 created.
14 - trunk is 1.4.3 in development.
15 - --enable-alloc-lite debug option.
16
017 8 March 2010: Wouter
118 - iana portlist updated.
219
0 README for Unbound 1.4.2
0 README for Unbound 1.4.3
11 Copyright 2007 NLnet Labs
22 http://unbound.net
33
0 .TH "libunbound" "3" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "libunbound" "3" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
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.2 functions.
44 \- Unbound DNS validating resolver 1.4.3 functions.
4545 .SH "SYNOPSIS"
4646 .LP
4747 .B #include <unbound.h>
0 .TH "unbound-checkconf" "8" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "unbound-checkconf" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
11 .\"
22 .\" unbound-checkconf.8 -- unbound configuration checker manual
33 .\"
0 .TH "unbound-control" "8" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "unbound-control" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
11 .\"
22 .\" unbound-control.8 -- unbound remote control manual
33 .\"
0 .TH "unbound\-host" "1" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "unbound\-host" "1" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
11 .\"
22 .\" unbound-host.1 -- unbound DNS lookup utility
33 .\"
0 .TH "unbound" "8" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "unbound" "8" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
11 .\"
22 .\" unbound.8 -- unbound manual
33 .\"
99 .SH "NAME"
1010 .LP
1111 .B unbound
12 \- Unbound DNS validating resolver 1.4.2.
12 \- Unbound DNS validating resolver 1.4.3.
1313 .SH "SYNOPSIS"
1414 .LP
1515 .B unbound
0 .TH "unbound.conf" "5" "Mar 9, 2010" "NLnet Labs" "unbound 1.4.2"
0 .TH "unbound.conf" "5" "Mar 11, 2010" "NLnet Labs" "unbound 1.4.3"
11 .\"
22 .\" unbound.conf.5 -- unbound.conf manual
33 .\"
483483 if(!rdf) {
484484 return 0;
485485 }
486 #ifdef UNBOUND_ALLOC_LITE
487 qinfo->qname = memdup(ldns_rdf_data(rdf), ldns_rdf_size(rdf));
488 qinfo->qname_len = ldns_rdf_size(rdf);
489 ldns_rdf_deep_free(rdf);
490 rdf = 0;
491 #else
486492 qinfo->qname = ldns_rdf_data(rdf);
487493 qinfo->qname_len = ldns_rdf_size(rdf);
494 #endif
488495 edns->edns_present = 1;
489496 edns->ext_rcode = 0;
490497 edns->edns_version = 0;
4646 #undef calloc
4747 #undef free
4848 #undef realloc
49 #endif
50 #ifdef UNBOUND_ALLOC_LITE
51 #undef malloc
52 #undef calloc
53 #undef free
54 #undef realloc
55 #undef strdup
56 #define unbound_lite_wrapstr(s) s
4957 #endif
5058 #include "libunbound/unbound.h"
5159 #include <ldns/ldns.h>
4444 #include "libunbound/context.h"
4545 #include "util/locks.h"
4646 #include "util/log.h"
47 #ifdef UNBOUND_ALLOC_LITE
48 #undef malloc
49 #undef calloc
50 #undef realloc
51 #undef free
52 #undef strdup
53 #endif
4754
4855 /** keeping track of the async ids */
4956 struct track_id {
66 NEED_NC='fwd_compress_c00c.tpkg fwd_zero.tpkg'
77 NEED_CURL='06-ianaports.tpkg'
88 NEED_WHOAMI='07-confroot.tpkg'
9 NEED_IPV6='fwd_ancil.tpkg fwd_tcp_tc6.tpkg'
9 NEED_IPV6='fwd_ancil.tpkg fwd_tcp_tc6.tpkg stub_udp6.tpkg'
1010 NEED_NOMINGW='tcp_sigpipe.tpkg 07-confroot.tpkg 08-host-lib.tpkg fwd_ancil.tpkg'
11
12 # test if dig, wdiff and ldns-testns are available.
13 if test ! -x "`which dig 2>&1`"; then echo No 'dig' in path; exit 1; fi
14 if test ! -x "`which wdiff 2>&1`"; then echo No 'wdiff' in path; exit 1; fi
15 if test ! -x "`which ldns-testns 2>&1`"; then echo No 'ldns-testns' in path; exit 1; fi
1116
1217 # test for ipv6, uses streamptcp peculiarity.
1318 if ./streamtcp -f ::1 2>&1 | grep "not supported" >/dev/null 2>&1; then
7272 #include "libunbound/unbound.h"
7373 #ifdef HAVE_SYS_STAT_H
7474 #include <sys/stat.h>
75 #endif
76 #ifdef UNBOUND_ALLOC_LITE
77 #undef malloc
78 #undef calloc
79 #undef realloc
80 #undef free
81 #undef strdup
82 #define unbound_lite_wrapstr(s) s
7583 #endif
7684 struct todo_item;
7785 struct labdata;
3030 /** string to show in warnings and errors */
3131 static const char* prog_name = "ldns-testpkts";
3232
33 #ifndef UTIL_LOG_H
34 /** verbosity definition for compat */
35 enum verbosity_value { NO_VERBOSE=0 };
36 #endif
3337 /** logging routine, provided by caller */
34 void verbose(int lvl, const char* msg, ...);
38 void verbose(enum verbosity_value lvl, const char* msg, ...) ATTR_FORMAT(printf, 2, 3);
3539
3640 /** print error and exit */
3741 static void error(const char* msg, ...)
588592 {
589593 if(ldns_rr_compare(ldns_rr_list_rr(q, i),
590594 ldns_rr_list_rr(p, i)) != 0) {
591 verbose(3, "rr %d different", i);
595 verbose(3, "rr %d different", (int)i);
592596 return 0;
593597 }
594598 if(mttl && ldns_rr_ttl(ldns_rr_list_rr(q, i)) !=
595599 ldns_rr_ttl(ldns_rr_list_rr(p, i))) {
596 verbose(3, "rr %d ttl different", i);
600 verbose(3, "rr %d ttl different", (int)i);
597601 return 0;
598602 }
599603 }
767771
768772 query_rr = ldns_rr_list_rr(ldns_pkt_question(query_pkt), 0);
769773 verbose(1, "query %d: id %d: %s %d bytes: ", ++(*count), (int)ldns_pkt_id(query_pkt),
770 (transport==transport_tcp)?"TCP":"UDP", inlen);
774 (transport==transport_tcp)?"TCP":"UDP", (int)inlen);
771775 if(verbose_out) ldns_rr_print(verbose_out, query_rr);
772776 if(verbose_out) ldns_pkt_print(verbose_out, query_pkt);
773777
Binary diff not shown
471471 }
472472
473473 #endif /* UNBOUND_ALLOC_STATS */
474 #ifdef UNBOUND_ALLOC_LITE
475 #undef malloc
476 #undef calloc
477 #undef free
478 #undef realloc
479 /** length of prefix and suffix */
480 static size_t lite_pad = 16;
481 /** prefix value to check */
482 static char* lite_pre = "checkfront123456";
483 /** suffix value to check */
484 static char* lite_post= "checkafter123456";
485
486 void *unbound_stat_malloc_lite(size_t size, const char* file, int line,
487 const char* func)
488 {
489 /* [prefix .. len .. actual data .. suffix] */
490 void* res = malloc(size+lite_pad*2+sizeof(size_t));
491 if(!res) return NULL;
492 memmove(res, lite_pre, lite_pad);
493 memmove(res+lite_pad, &size, sizeof(size_t));
494 memset(res+lite_pad+sizeof(size_t), 0x1a, size); /* init the memory */
495 memmove(res+lite_pad+size+sizeof(size_t), lite_post, lite_pad);
496 return res+lite_pad+sizeof(size_t);
497 }
498
499 void *unbound_stat_calloc_lite(size_t nmemb, size_t size, const char* file,
500 int line, const char* func)
501 {
502 size_t req = nmemb * size;
503 void* res = malloc(req+lite_pad*2+sizeof(size_t));
504 if(!res) return NULL;
505 memmove(res, lite_pre, lite_pad);
506 memmove(res+lite_pad, &req, sizeof(size_t));
507 memset(res+lite_pad+sizeof(size_t), 0, req);
508 memmove(res+lite_pad+req+sizeof(size_t), lite_post, lite_pad);
509 return res+lite_pad+sizeof(size_t);
510 }
511
512 void unbound_stat_free_lite(void *ptr, const char* file, int line,
513 const char* func)
514 {
515 void* real;
516 size_t orig = 0;
517 if(!ptr) return;
518 real = ptr-lite_pad-sizeof(size_t);
519 if(memcmp(real, lite_pre, lite_pad) != 0) {
520 log_err("free(): prefix failed %s:%d %s", file, line, func);
521 log_hex("prefix here", real, lite_pad);
522 log_hex(" should be", lite_pre, lite_pad);
523 fatal_exit("alloc assertion failed");
524 }
525 memmove(&orig, real+lite_pad, sizeof(size_t));
526 if(memcmp(real+lite_pad+orig+sizeof(size_t), lite_post, lite_pad)!=0){
527 log_err("free(): suffix failed %s:%d %s", file, line, func);
528 log_err("alloc size is %d", (int)orig);
529 log_hex("suffix here", real+lite_pad+orig+sizeof(size_t),
530 lite_pad);
531 log_hex(" should be", lite_post, lite_pad);
532 fatal_exit("alloc assertion failed");
533 }
534 memset(real, 0xdd, orig+lite_pad*2+sizeof(size_t)); /* mark it */
535 free(real);
536 }
537
538 void *unbound_stat_realloc_lite(void *ptr, size_t size, const char* file,
539 int line, const char* func)
540 {
541 /* always free and realloc (no growing) */
542 void* real, *newa;
543 size_t orig = 0;
544 if(!ptr) {
545 /* like malloc() */
546 return unbound_stat_malloc_lite(size, file, line, func);
547 }
548 if(!size) {
549 /* like free() */
550 unbound_stat_free_lite(ptr, file, line, func);
551 return NULL;
552 }
553 /* change allocation size and copy */
554 real = ptr-lite_pad-sizeof(size_t);
555 if(memcmp(real, lite_pre, lite_pad) != 0) {
556 log_err("realloc(): prefix failed %s:%d %s", file, line, func);
557 log_hex("prefix here", real, lite_pad);
558 log_hex(" should be", lite_pre, lite_pad);
559 fatal_exit("alloc assertion failed");
560 }
561 memmove(&orig, real+lite_pad, sizeof(size_t));
562 if(memcmp(real+lite_pad+orig+sizeof(size_t), lite_post, lite_pad)!=0){
563 log_err("realloc(): suffix failed %s:%d %s", file, line, func);
564 log_err("alloc size is %d", (int)orig);
565 log_hex("suffix here", real+lite_pad+orig+sizeof(size_t),
566 lite_pad);
567 log_hex(" should be", lite_post, lite_pad);
568 fatal_exit("alloc assertion failed");
569 }
570 /* new alloc and copy over */
571 newa = unbound_stat_malloc_lite(size, file, line, func);
572 if(!newa)
573 return NULL;
574 if(orig < size)
575 memmove(newa, ptr, orig);
576 else memmove(newa, ptr, size);
577 memset(real, 0xdd, orig+lite_pad*2+sizeof(size_t)); /* mark it */
578 free(real);
579 return newa;
580 }
581
582 char* unbound_strdup_lite(const char* s, const char* file, int line,
583 const char* func)
584 {
585 /* this routine is made to make sure strdup() uses the malloc_lite */
586 size_t l = strlen(s)+1;
587 char* n = (char*)unbound_stat_malloc_lite(l, file, line, func);
588 if(!n) return NULL;
589 memmove(n, s, l);
590 return n;
591 }
592
593 char* unbound_lite_wrapstr(char* s)
594 {
595 char* n = unbound_strdup_lite(s, __FILE__, __LINE__, __func__);
596 free(s);
597 return n;
598 }
599
600 #undef ldns_pkt2wire
601 ldns_status unbound_lite_pkt2wire(uint8_t **dest, const ldns_pkt *p,
602 size_t *size)
603 {
604 uint8_t* md = NULL;
605 size_t ms = 0;
606 ldns_status s = ldns_pkt2wire(&md, p, &ms);
607 if(md) {
608 *dest = unbound_stat_malloc_lite(ms, __FILE__, __LINE__,
609 __func__);
610 *size = ms;
611 if(!*dest) { free(md); return LDNS_STATUS_MEM_ERR; }
612 memcpy(*dest, md, ms);
613 free(md);
614 } else {
615 *dest = NULL;
616 *size = 0;
617 }
618 return s;
619 }
620
621 #undef i2d_DSA_SIG
622 int unbound_lite_i2d_DSA_SIG(DSA_SIG* dsasig, unsigned char** sig)
623 {
624 unsigned char* n = NULL;
625 int r= i2d_DSA_SIG(dsasig, &n);
626 if(n) {
627 *sig = unbound_stat_malloc_lite((size_t)r, __FILE__, __LINE__,
628 __func__);
629 if(!*sig) return -1;
630 memcpy(*sig, n, (size_t)r);
631 free(n);
632 return r;
633 }
634 *sig = NULL;
635 return r;
636 }
637
638 #endif /* UNBOUND_ALLOC_LITE */
175175 void alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
176176 void* arg);
177177
178 #ifdef UNBOUND_ALLOC_LITE
179 # define malloc(s) unbound_stat_malloc_lite(s, __FILE__, __LINE__, __func__)
180 # define calloc(n,s) unbound_stat_calloc_lite(n, s, __FILE__, __LINE__, __func__)
181 # define free(p) unbound_stat_free_lite(p, __FILE__, __LINE__, __func__)
182 # define realloc(p,s) unbound_stat_realloc_lite(p, s, __FILE__, __LINE__, __func__)
183 void *unbound_stat_malloc_lite(size_t size, const char* file, int line,
184 const char* func);
185 void *unbound_stat_calloc_lite(size_t nmemb, size_t size, const char* file,
186 int line, const char* func);
187 void unbound_stat_free_lite(void *ptr, const char* file, int line,
188 const char* func);
189 void *unbound_stat_realloc_lite(void *ptr, size_t size, const char* file,
190 int line, const char* func);
191 # ifdef strdup
192 # undef strdup
193 # endif
194 # define strdup(s) unbound_strdup_lite(s, __FILE__, __LINE__, __func__)
195 char* unbound_strdup_lite(const char* s, const char* file, int line,
196 const char* func);
197 char* unbound_lite_wrapstr(char* s);
198 # define ldns_rr2str(rr) unbound_lite_wrapstr(ldns_rr2str(rr))
199 # define ldns_rdf2str(rdf) unbound_lite_wrapstr(ldns_rdf2str(rdf))
200 # define ldns_rr_type2str(t) unbound_lite_wrapstr(ldns_rr_type2str(t))
201 # define ldns_rr_class2str(c) unbound_lite_wrapstr(ldns_rr_class2str(c))
202 # define ldns_rr_list2str(r) unbound_lite_wrapstr(ldns_rr_list2str(r))
203 # define ldns_pkt2str(p) unbound_lite_wrapstr(ldns_pkt2str(p))
204 # define ldns_pkt_rcode2str(r) unbound_lite_wrapstr(ldns_pkt_rcode2str(r))
205 # define ldns_pkt2wire(a, r, s) unbound_lite_pkt2wire(a, r, s)
206 ldns_status unbound_lite_pkt2wire(uint8_t **dest, const ldns_pkt *p, size_t *size);
207 # define i2d_DSA_SIG(d, s) unbound_lite_i2d_DSA_SIG(d, s)
208 int unbound_lite_i2d_DSA_SIG(DSA_SIG* dsasig, unsigned char** sig);
209 #endif /* UNBOUND_ALLOC_LITE */
210
178211 #endif /* UTIL_ALLOC_H */
496496 socklen_t len, struct regional* region)
497497 {
498498 struct sock_list* add = (struct sock_list*)regional_alloc(region,
499 sizeof(add->next) + sizeof(add->len) + (size_t)len);
499 sizeof(*add) - sizeof(add->addr) + (size_t)len);
500500 if(!add) {
501501 log_err("out of memory in socketlist insert");
502502 return;
5353
5454 /** Default reasonable size for chunks */
5555 #define REGIONAL_CHUNK_SIZE 8192
56 #ifdef UNBOUND_ALLOC_NONREGIONAL
57 /** All objects allocated outside of chunks, for debug */
58 #define REGIONAL_LARGE_OBJECT_SIZE 0
59 #else
5660 /** Default size for large objects - allocated outside of chunks. */
5761 #define REGIONAL_LARGE_OBJECT_SIZE 2048
62 #endif
5863
5964 struct regional*
6065 regional_create()