diff options
author | Internet Software Consortium, Inc <@isc.org> | 2012-02-17 17:33:47 -0700 |
---|---|---|
committer | Internet Software Consortium, Inc <@isc.org> | 2012-02-17 17:33:47 -0700 |
commit | c4acc4f1e2f6b8c7f3657cfe453c3ca164a9343a (patch) | |
tree | 7338ac84814b5d91b93dbc6f9e60898de940a81a /lib | |
parent | f8bb4eefd76094703b91acc987d8df0603639376 (diff) | |
download | bind9-c4acc4f1e2f6b8c7f3657cfe453c3ca164a9343a.tar.gz |
9.9.0rc2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bind9/api | 5 | ||||
-rw-r--r-- | lib/dns/api | 7 | ||||
-rw-r--r-- | lib/dns/include/dns/time.h | 10 | ||||
-rw-r--r-- | lib/dns/include/dns/zone.h | 6 | ||||
-rw-r--r-- | lib/dns/nsec3.c | 8 | ||||
-rw-r--r-- | lib/dns/rbtdb.c | 4 | ||||
-rw-r--r-- | lib/dns/tests/Makefile.in | 14 | ||||
-rw-r--r-- | lib/dns/tests/nsec3_test.c | 86 | ||||
-rw-r--r-- | lib/dns/tests/testdata/nsec3/1024.db | 21 | ||||
-rw-r--r-- | lib/dns/tests/testdata/nsec3/2048.db | 21 | ||||
-rw-r--r-- | lib/dns/tests/testdata/nsec3/4096.db | 21 | ||||
-rw-r--r-- | lib/dns/tests/testdata/nsec3/min-1024.db | 25 | ||||
-rw-r--r-- | lib/dns/tests/testdata/nsec3/min-2048.db | 23 | ||||
-rw-r--r-- | lib/dns/time.c | 16 | ||||
-rw-r--r-- | lib/dns/win32/libdns.def | 1 | ||||
-rw-r--r-- | lib/dns/zone.c | 229 | ||||
-rw-r--r-- | lib/irs/api | 5 | ||||
-rw-r--r-- | lib/isc/api | 11 | ||||
-rw-r--r-- | lib/isc/include/isc/result.h | 7 | ||||
-rw-r--r-- | lib/isc/result.c | 5 | ||||
-rw-r--r-- | lib/isc/unix/socket.c | 39 | ||||
-rw-r--r-- | lib/isccc/api | 5 | ||||
-rw-r--r-- | lib/isccfg/api | 5 | ||||
-rw-r--r-- | lib/lwres/api | 5 |
24 files changed, 457 insertions, 122 deletions
diff --git a/lib/bind9/api b/lib/bind9/api index 2a59ac92..e34aa945 100644 --- a/lib/bind9/api +++ b/lib/bind9/api @@ -1,3 +1,8 @@ +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 LIBINTERFACE = 90 LIBREVISION = 2 LIBAGE = 0 diff --git a/lib/dns/api b/lib/dns/api index 63ac0c79..332a0c54 100644 --- a/lib/dns/api +++ b/lib/dns/api @@ -1,3 +1,8 @@ -LIBINTERFACE = 92 +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 +LIBINTERFACE = 93 LIBREVISION = 0 LIBAGE = 0 diff --git a/lib/dns/include/dns/time.h b/lib/dns/include/dns/time.h index 3771e9a8..7281a334 100644 --- a/lib/dns/include/dns/time.h +++ b/lib/dns/include/dns/time.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.h,v 1.17 2007-06-19 23:47:17 tbox Exp $ */ +/* $Id: time.h,v 1.19 2012-01-27 23:46:58 tbox Exp $ */ #ifndef DNS_TIME_H #define DNS_TIME_H 1 @@ -67,6 +67,12 @@ dns_time32_totext(isc_uint32_t value, isc_buffer_t *target); * current date is chosen. */ +isc_int64_t +dns_time64_from32(isc_uint32_t value); +/*%< + * Covert a 32-bit cyclic time value into a 64 bit time stamp. + */ + ISC_LANG_ENDDECLS #endif /* DNS_TIME_H */ diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 765f73fa..d5cb5b98 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.h,v 1.199 2011-12-22 07:32:41 each Exp $ */ +/* $Id: zone.h,v 1.201 2012-01-25 23:46:49 tbox Exp $ */ #ifndef DNS_ZONE_H #define DNS_ZONE_H 1 @@ -2007,7 +2007,7 @@ dns_zone_getserialupdatemethod(dns_zone_t *zone); * \li 'zone' to be valid. */ -void +isc_result_t dns_zone_link(dns_zone_t *zone, dns_zone_t *raw); void diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c index 2217e5c9..d7e120ed 100644 --- a/lib/dns/nsec3.c +++ b/lib/dns/nsec3.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2008-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2006, 2008-2012 Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nsec3.c,v 1.24 2011-10-28 06:20:06 each Exp $ */ +/* $Id: nsec3.c,v 1.26 2012-01-27 23:46:58 tbox Exp $ */ #include <config.h> @@ -1788,7 +1788,7 @@ dns_nsec3_maxiterations(dns_db_t *db, dns_dbversion_t *version, dst_key_t *key = NULL; isc_buffer_t buffer; isc_result_t result; - isc_uint16_t bits, minbits = 4096; + unsigned int bits, minbits = 4096; result = dns_db_getoriginnode(db, &node); if (result != ISC_R_SUCCESS) @@ -1815,7 +1815,7 @@ dns_nsec3_maxiterations(dns_db_t *db, dns_dbversion_t *version, isc_buffer_add(&buffer, rdata.length); CHECK(dst_key_fromdns(dns_db_origin(db), rdataset.rdclass, &buffer, mctx, &key)); - bits = dst_key_getbits(key); + bits = dst_key_size(key); dst_key_free(&key); if (minbits > bits) minbits = bits; diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c index 7091a399..961fe1e3 100644 --- a/lib/dns/rbtdb.c +++ b/lib/dns/rbtdb.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rbtdb.c,v 1.323 2011-12-07 22:21:05 marka Exp $ */ +/* $Id: rbtdb.c,v 1.326 2012-01-04 23:46:49 tbox Exp $ */ /*! \file */ diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in index 8e802d73..191ff7d9 100644 --- a/lib/dns/tests/Makefile.in +++ b/lib/dns/tests/Makefile.in @@ -1,4 +1,4 @@ -# Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2011, 2012 Internet Systems Consortium, Inc. ("ISC") # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -12,7 +12,7 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -# $Id: Makefile.in,v 1.12 2011-12-08 16:07:21 each Exp $ +# $Id: Makefile.in,v 1.14 2012-01-27 23:46:58 tbox Exp $ srcdir = @srcdir@ VPATH = @srcdir@ @@ -39,12 +39,13 @@ LIBS = @LIBS@ @ATFLIBS@ OBJS = dnstest.@O@ SRCS = dnstest.c master_test.c dbiterator_test.c time_test.c \ private_test.c update_test.c zonemgr_test.c zt_test.c \ - dbdiff_test.c + dbdiff_test.c nsec3_test.c SUBDIRS = TARGETS = master_test@EXEEXT@ dbiterator_test@EXEEXT@ time_test@EXEEXT@ \ private_test@EXEEXT@ update_test@EXEEXT@ zonemgr_test@EXEEXT@ \ - zt_test@EXEEXT@ dbversion_test@EXEEXT@ dbdiff_test@EXEEXT@ + zt_test@EXEEXT@ dbversion_test@EXEEXT@ dbdiff_test@EXEEXT@ \ + nsec3_test@EXEEXT@ @BIND9_MAKE_RULES@ @@ -99,6 +100,11 @@ zt_test@EXEEXT@: zt_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} zt_test.@O@ dnstest.@O@ ${DNSLIBS} \ ${ISCLIBS} ${LIBS} +nsec3_test@EXEEXT@: nsec3_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} + ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ + nsec3_test.@O@ dnstest.@O@ ${DNSLIBS} \ + ${ISCLIBS} ${LIBS} + unit:: sh ${top_srcdir}/unit/unittest.sh diff --git a/lib/dns/tests/nsec3_test.c b/lib/dns/tests/nsec3_test.c new file mode 100644 index 00000000..3867ac8e --- /dev/null +++ b/lib/dns/tests/nsec3_test.c @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* $Id: nsec3_test.c,v 1.2 2012-01-27 00:49:42 marka Exp $ */ + +/*! \file */ + +#include <config.h> + +#include <atf-c.h> + +#include <unistd.h> + +#include <dns/db.h> +#include <dns/nsec3.h> + +#include "dnstest.h" + +/* + * Helper functions + */ + +static void +iteration_test(const char* file, unsigned int expected) { + isc_result_t result; + dns_db_t *db = NULL; + unsigned int iterations; + + result = dns_test_begin(NULL, ISC_FALSE); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + result = dns_test_loaddb(&db, dns_dbtype_zone, "test", file); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + result = dns_nsec3_maxiterations(db, NULL, mctx, &iterations); + ATF_REQUIRE_EQ(result, ISC_R_SUCCESS); + + ATF_REQUIRE_EQ(iterations, expected); + + dns_db_detach(&db); + + dns_test_end(); +} + +/* + * Individual unit tests + */ + +ATF_TC(max_iterations); +ATF_TC_HEAD(max_iterations, tc) { + atf_tc_set_md_var(tc, "descr", "check that appropriate max iterations " + " is returned for different key size mixes"); +} +ATF_TC_BODY(max_iterations, tc) { + + UNUSED(tc); + + iteration_test("testdata/nsec3/1024.db", 150); + iteration_test("testdata/nsec3/2048.db", 500); + iteration_test("testdata/nsec3/4096.db", 2500); + iteration_test("testdata/nsec3/min-1024.db", 150); + iteration_test("testdata/nsec3/min-2048.db", 500); +} + +/* + * Main + */ +ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, max_iterations); + + return (atf_no_error()); +} + diff --git a/lib/dns/tests/testdata/nsec3/1024.db b/lib/dns/tests/testdata/nsec3/1024.db new file mode 100644 index 00000000..3d9c43bf --- /dev/null +++ b/lib/dns/tests/testdata/nsec3/1024.db @@ -0,0 +1,21 @@ +; Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +; $Id: 1024.db,v 1.3 2012-01-27 23:46:58 tbox Exp $ + +$TTL 0 +test. SOA . . 0 0 0 0 0 +test. NS . +; 1024 bit key. +test. IN DNSKEY 256 3 5 AwEAAd5oKx06HRE6NRrTDz49lljdRmxgp/4YB/cyMkpwUMkaLhDNCfTq hql84ab2LRbtUWLHFXGWENvxPGQzVHeleXu+3ThNfFOwIaySedxHmLGT lTtBRDhPc8iSb+2IYDemmA+ut8kwHhCVz/tDMbD/dgAswdOtmXCpQyJk Q1HqY3Xj diff --git a/lib/dns/tests/testdata/nsec3/2048.db b/lib/dns/tests/testdata/nsec3/2048.db new file mode 100644 index 00000000..bc263ed9 --- /dev/null +++ b/lib/dns/tests/testdata/nsec3/2048.db @@ -0,0 +1,21 @@ +; Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +; $Id: 2048.db,v 1.3 2012-01-27 23:46:58 tbox Exp $ + +$TTL 0 +test. SOA . . 0 0 0 0 0 +test. NS . +; 2048 bits +test. IN DNSKEY 256 3 5 AwEAAcfQX59iZr9gK+XzhTZQ5KWrfCLA0iYHTqheEIhC2dXS8gUSppQS g9SmzH2129u/LSSb7gqJSoLLAsn36iinqCqUXl2BT6xzwznbSP3mn0hn N6DegsykcYhHycKH6ifjZiMN+SGGeNsi5rhoW5Cj9ptw3C3yQnrFNDbS GZCT97z5lpQU3ZcvP4RDNk7dhri7Bh3SJeaCFoqx00NgFvlBR48hosSG bGUbUKzNf58GBTkW4Us2jIWsreZx8LLLev232Hy7NU9L19k+hVq7pJOf Uvtrn5fmGSutWOzsR+8EacOnh0lwssCKjutk5MSmfdFC5P7CTZkdq58L 8he13HGmr00= diff --git a/lib/dns/tests/testdata/nsec3/4096.db b/lib/dns/tests/testdata/nsec3/4096.db new file mode 100644 index 00000000..cc54d75a --- /dev/null +++ b/lib/dns/tests/testdata/nsec3/4096.db @@ -0,0 +1,21 @@ +; Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +; $Id: 4096.db,v 1.3 2012-01-27 23:46:58 tbox Exp $ + +$TTL 0 +test. SOA . . 0 0 0 0 0 +test. NS . +; 4096 bits +test. IN DNSKEY 256 3 5 AwEAAbYlqbKxXoq9mzkqdsAaSZ3XywBVAb2sCTgrQBCExyGEYNpWw3LN +imCrLQi7jHKQW6GZIqKNgQaiFEwr3zK8nPWbwNwyKU9a2hhINv/gim1 5iA87Vu7DiiJrQ0O79ospvsGsKknBQ41zaaQMp3Q/W1S6WNe4uyh4C/f R0qmxT+8MyXEqCpTGb+e+YT6BuqpNQPuYYYvUJ1/HJltzY/lY2b9RZ+Q ZJ23Zje79YIRM0kJapqj11fDUDeynhDL1DUikYCwRfQiO/blChhOHjIa uTK1qqRY3fqanLGOufpLTr7GRpL7RxeRIMJfDzmcjFLmCsMA1AJ56Bxq jiXr3ODgn9D30vAB74Lr7lqLQSWyrSlJjoZLLhmPrEP/nnuCxEhOhDRA XJpJWpcQ4Hdu+yb5K/qldnsGLLI1Hr0GmhLTDHsxDb6BxM7/8rv8QeQY GKSGshBqD2lO1xUVT8inbi8uXI1iyN68vHX6xoFT5wsjls70PxSZPO5i F40vn6BWNsHtKWOCDqMKYx8hYwiv0zETVwxBaj58vylFwYGU+g1wIQmF Pgi2HKv4KaxgikUvdFISre5rxVoG5VrmmXWiNJcLTbwZ+tE1xujCNU1c V31CaIB5hdSnkEvQADr5V64RTxWAKuSLNMU+XUqTkaJHasSm3OPJOteo SPj2uoesuxNFYps3 diff --git a/lib/dns/tests/testdata/nsec3/min-1024.db b/lib/dns/tests/testdata/nsec3/min-1024.db new file mode 100644 index 00000000..026ad9b0 --- /dev/null +++ b/lib/dns/tests/testdata/nsec3/min-1024.db @@ -0,0 +1,25 @@ +; Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +; $Id: min-1024.db,v 1.3 2012-01-27 23:46:58 tbox Exp $ + +$TTL 0 +test. SOA . . 0 0 0 0 0 +test. NS . +; 1024 bit key. +test. IN DNSKEY 256 3 5 AwEAAd5oKx06HRE6NRrTDz49lljdRmxgp/4YB/cyMkpwUMkaLhDNCfTq hql84ab2LRbtUWLHFXGWENvxPGQzVHeleXu+3ThNfFOwIaySedxHmLGT lTtBRDhPc8iSb+2IYDemmA+ut8kwHhCVz/tDMbD/dgAswdOtmXCpQyJk Q1HqY3Xj +; 2048 bits +test. IN DNSKEY 256 3 5 AwEAAcfQX59iZr9gK+XzhTZQ5KWrfCLA0iYHTqheEIhC2dXS8gUSppQS g9SmzH2129u/LSSb7gqJSoLLAsn36iinqCqUXl2BT6xzwznbSP3mn0hn N6DegsykcYhHycKH6ifjZiMN+SGGeNsi5rhoW5Cj9ptw3C3yQnrFNDbS GZCT97z5lpQU3ZcvP4RDNk7dhri7Bh3SJeaCFoqx00NgFvlBR48hosSG bGUbUKzNf58GBTkW4Us2jIWsreZx8LLLev232Hy7NU9L19k+hVq7pJOf Uvtrn5fmGSutWOzsR+8EacOnh0lwssCKjutk5MSmfdFC5P7CTZkdq58L 8he13HGmr00= +; 4096 bits +test. IN DNSKEY 256 3 5 AwEAAbYlqbKxXoq9mzkqdsAaSZ3XywBVAb2sCTgrQBCExyGEYNpWw3LN +imCrLQi7jHKQW6GZIqKNgQaiFEwr3zK8nPWbwNwyKU9a2hhINv/gim1 5iA87Vu7DiiJrQ0O79ospvsGsKknBQ41zaaQMp3Q/W1S6WNe4uyh4C/f R0qmxT+8MyXEqCpTGb+e+YT6BuqpNQPuYYYvUJ1/HJltzY/lY2b9RZ+Q ZJ23Zje79YIRM0kJapqj11fDUDeynhDL1DUikYCwRfQiO/blChhOHjIa uTK1qqRY3fqanLGOufpLTr7GRpL7RxeRIMJfDzmcjFLmCsMA1AJ56Bxq jiXr3ODgn9D30vAB74Lr7lqLQSWyrSlJjoZLLhmPrEP/nnuCxEhOhDRA XJpJWpcQ4Hdu+yb5K/qldnsGLLI1Hr0GmhLTDHsxDb6BxM7/8rv8QeQY GKSGshBqD2lO1xUVT8inbi8uXI1iyN68vHX6xoFT5wsjls70PxSZPO5i F40vn6BWNsHtKWOCDqMKYx8hYwiv0zETVwxBaj58vylFwYGU+g1wIQmF Pgi2HKv4KaxgikUvdFISre5rxVoG5VrmmXWiNJcLTbwZ+tE1xujCNU1c V31CaIB5hdSnkEvQADr5V64RTxWAKuSLNMU+XUqTkaJHasSm3OPJOteo SPj2uoesuxNFYps3 diff --git a/lib/dns/tests/testdata/nsec3/min-2048.db b/lib/dns/tests/testdata/nsec3/min-2048.db new file mode 100644 index 00000000..e9dc6a64 --- /dev/null +++ b/lib/dns/tests/testdata/nsec3/min-2048.db @@ -0,0 +1,23 @@ +; Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +; +; Permission to use, copy, modify, and/or distribute this software for any +; purpose with or without fee is hereby granted, provided that the above +; copyright notice and this permission notice appear in all copies. +; +; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +; PERFORMANCE OF THIS SOFTWARE. + +; $Id: min-2048.db,v 1.3 2012-01-27 23:46:58 tbox Exp $ + +$TTL 0 +test. SOA . . 0 0 0 0 0 +test. NS . +; 2048 bits +test. IN DNSKEY 256 3 5 AwEAAcfQX59iZr9gK+XzhTZQ5KWrfCLA0iYHTqheEIhC2dXS8gUSppQS g9SmzH2129u/LSSb7gqJSoLLAsn36iinqCqUXl2BT6xzwznbSP3mn0hn N6DegsykcYhHycKH6ifjZiMN+SGGeNsi5rhoW5Cj9ptw3C3yQnrFNDbS GZCT97z5lpQU3ZcvP4RDNk7dhri7Bh3SJeaCFoqx00NgFvlBR48hosSG bGUbUKzNf58GBTkW4Us2jIWsreZx8LLLev232Hy7NU9L19k+hVq7pJOf Uvtrn5fmGSutWOzsR+8EacOnh0lwssCKjutk5MSmfdFC5P7CTZkdq58L 8he13HGmr00= +; 4096 bits +test. IN DNSKEY 256 3 5 AwEAAbYlqbKxXoq9mzkqdsAaSZ3XywBVAb2sCTgrQBCExyGEYNpWw3LN +imCrLQi7jHKQW6GZIqKNgQaiFEwr3zK8nPWbwNwyKU9a2hhINv/gim1 5iA87Vu7DiiJrQ0O79ospvsGsKknBQ41zaaQMp3Q/W1S6WNe4uyh4C/f R0qmxT+8MyXEqCpTGb+e+YT6BuqpNQPuYYYvUJ1/HJltzY/lY2b9RZ+Q ZJ23Zje79YIRM0kJapqj11fDUDeynhDL1DUikYCwRfQiO/blChhOHjIa uTK1qqRY3fqanLGOufpLTr7GRpL7RxeRIMJfDzmcjFLmCsMA1AJ56Bxq jiXr3ODgn9D30vAB74Lr7lqLQSWyrSlJjoZLLhmPrEP/nnuCxEhOhDRA XJpJWpcQ4Hdu+yb5K/qldnsGLLI1Hr0GmhLTDHsxDb6BxM7/8rv8QeQY GKSGshBqD2lO1xUVT8inbi8uXI1iyN68vHX6xoFT5wsjls70PxSZPO5i F40vn6BWNsHtKWOCDqMKYx8hYwiv0zETVwxBaj58vylFwYGU+g1wIQmF Pgi2HKv4KaxgikUvdFISre5rxVoG5VrmmXWiNJcLTbwZ+tE1xujCNU1c V31CaIB5hdSnkEvQADr5V64RTxWAKuSLNMU+XUqTkaJHasSm3OPJOteo SPj2uoesuxNFYps3 diff --git a/lib/dns/time.c b/lib/dns/time.c index 48b67777..42d3184d 100644 --- a/lib/dns/time.c +++ b/lib/dns/time.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2009-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2009-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.c,v 1.37 2011-03-09 23:47:17 tbox Exp $ */ +/* $Id: time.c,v 1.39 2012-01-27 23:46:58 tbox Exp $ */ /*! \file */ @@ -103,8 +103,8 @@ dns_time64_totext(isc_int64_t t, isc_buffer_t *target) { return (ISC_R_SUCCESS); } -isc_result_t -dns_time32_totext(isc_uint32_t value, isc_buffer_t *target) { +isc_int64_t +dns_time64_from32(isc_uint32_t value) { isc_stdtime_t now; isc_int64_t start; isc_int64_t t; @@ -121,7 +121,13 @@ dns_time32_totext(isc_uint32_t value, isc_buffer_t *target) { t = start + (value - now); else t = start - (now - value); - return (dns_time64_totext(t, target)); + + return (t); +} + +isc_result_t +dns_time32_totext(isc_uint32_t value, isc_buffer_t *target) { + return (dns_time64_totext(dns_time64_from32(value), target)); } isc_result_t diff --git a/lib/dns/win32/libdns.def b/lib/dns/win32/libdns.def index 615d068f..bf16469f 100644 --- a/lib/dns/win32/libdns.def +++ b/lib/dns/win32/libdns.def @@ -686,6 +686,7 @@ dns_tcpmsg_readmessage dns_tcpmsg_setmaxsize dns_time32_fromtext dns_time32_totext +dns_time64_from32 dns_time64_fromtext dns_time64_totext dns_timer_setidle diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 30e35227..171ea698 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.658 2011-12-22 07:32:41 each Exp $ */ +/* $Id: zone.c,v 1.667.2.1 2012-01-31 01:11:55 each Exp $ */ /*! \file */ @@ -76,6 +76,7 @@ #include <dns/soa.h> #include <dns/ssu.h> #include <dns/stats.h> +#include <dns/time.h> #include <dns/tsig.h> #include <dns/update.h> #include <dns/xfrin.h> @@ -655,7 +656,7 @@ static void zone_name_tostr(dns_zone_t *zone, char *buf, size_t length); static void zone_rdclass_tostr(dns_zone_t *zone, char *buf, size_t length); static void zone_viewname_tostr(dns_zone_t *zone, char *buf, size_t length); static isc_result_t zone_send_secureserial(dns_zone_t *zone, - isc_boolean_t locked, + isc_boolean_t secure_locked, isc_uint32_t serial); #if 0 @@ -1491,15 +1492,20 @@ zone_load(dns_zone_t *zone, unsigned int flags) { REQUIRE(DNS_ZONE_VALID(zone)); - LOCK_ZONE(zone); - TIME_NOW(&now); - if (inline_secure(zone)) { result = zone_load(zone->raw, flags); if (result != ISC_R_SUCCESS) - goto cleanup; + return(result); } + /* + * Lock hierachy zmgr, raw, zone. + */ + if (inline_secure(zone)) + LOCK_ZONE(zone->raw); + LOCK_ZONE(zone); + TIME_NOW(&now); + INSIST(zone->type != dns_zone_none); if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_LOADING)) { @@ -1652,6 +1658,8 @@ zone_load(dns_zone_t *zone, unsigned int flags) { cleanup: UNLOCK_ZONE(zone); + if (inline_secure(zone)) + UNLOCK_ZONE(zone->raw); if (db != NULL) dns_db_detach(&db); return (result); @@ -1795,9 +1803,9 @@ get_master_options(dns_zone_t *zone) { options |= DNS_MASTER_CHECKMXFAIL; if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_CHECKWILDCARD)) options |= DNS_MASTER_CHECKWILDCARD; - if (zone->type == dns_zone_master && + if (inline_secure(zone) || (zone->type == dns_zone_master && ((zone->update_acl != NULL && !dns_acl_isnone(zone->update_acl)) || - zone->ssutable != NULL)) + zone->ssutable != NULL))) options |= DNS_MASTER_RESIGN; return (options); } @@ -3561,7 +3569,6 @@ maybe_send_secure(dns_zone_t *zone) { * loaded, we set a flag so that it will send the necessary * information when it has finished loading. */ - LOCK_ZONE(zone->raw); if (zone->raw->db != NULL) { if (zone->db != NULL) { isc_uint32_t serial; @@ -3569,15 +3576,12 @@ maybe_send_secure(dns_zone_t *zone) { NULL, NULL, &serial, NULL, NULL, NULL, NULL, NULL); if (result == ISC_R_SUCCESS) - zone_send_secureserial(zone->raw, ISC_TRUE, - serial); + zone_send_secureserial(zone->raw, ISC_TRUE, serial); } else zone_send_securedb(zone->raw, ISC_TRUE, zone->raw->db); - + } else DNS_ZONE_SETFLAG(zone->raw, DNS_ZONEFLG_SENDSECURE); - - UNLOCK_ZONE(zone->raw); } static isc_boolean_t @@ -3764,9 +3768,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, } } - zone->loadtime = loadtime; - - dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded"); + dns_zone_log(zone, ISC_LOG_DEBUG(1), "loaded; checking validity"); /* * Master / Slave / Stub zones require both NS and SOA records at @@ -4029,6 +4031,7 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, dns_zone_log(zone, ISC_LOG_INFO, "loaded serial %u%s", serial, dns_db_issecure(db) ? " (DNSSEC signed)" : ""); + zone->loadtime = loadtime; DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_LOADPENDING); return (result); @@ -4048,8 +4051,11 @@ zone_postload(dns_zone_t *zone, dns_db_t *db, isc_time_t loadtime, zone_settimer(zone, &now); result = ISC_R_SUCCESS; } else if (zone->type == dns_zone_master || - zone->type == dns_zone_redirect) - dns_zone_log(zone, ISC_LOG_ERROR, "not loaded due to errors."); + zone->type == dns_zone_redirect) { + if (!(inline_secure(zone) && result == ISC_R_FILENOTFOUND)) + dns_zone_log(zone, ISC_LOG_ERROR, + "not loaded due to errors."); + } return (result); } @@ -5074,7 +5080,7 @@ del_sigs(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, unsigned int i; dns_rdata_rrsig_t rrsig; isc_boolean_t found, changed; - isc_stdtime_t warn = 0, maybe = 0; + isc_int64_t warn = 0, maybe = 0; dns_rdataset_init(&rdataset); @@ -5176,21 +5182,20 @@ del_sigs(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, * iff there is a new offline signature. */ if (!dst_key_isprivate(keys[i])) { - if (warn != 0 && - warn > rrsig.timeexpire) - warn = rrsig.timeexpire; + isc_int64_t timeexpire = + dns_time64_from32(rrsig.timeexpire); + if (warn != 0 && warn > timeexpire) + warn = timeexpire; if (rdata.flags & DNS_RDATA_OFFLINE) { if (maybe == 0 || - maybe > rrsig.timeexpire) - maybe = - rrsig.timeexpire; + maybe > timeexpire) + maybe = timeexpire; break; } if (warn == 0) warn = maybe; - if (warn == 0 || - warn > rrsig.timeexpire) - warn = rrsig.timeexpire; + if (warn == 0 || warn > timeexpire) + warn = timeexpire; result = offline(db, ver, diff, name, rdataset.ttl, &rdata); break; @@ -5221,8 +5226,18 @@ del_sigs(dns_zone_t *zone, dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name, dns_rdataset_disassociate(&rdataset); if (result == ISC_R_NOMORE) result = ISC_R_SUCCESS; - if (warn != 0) - set_key_expiry_warning(zone, warn, now); + if (warn > 0) { +#if defined(STDTIME_ON_32BITS) + isc_stdtime_t stdwarn = (isc_stdtime_t)warn; + if (warn == stdwarn) +#endif + set_key_expiry_warning(zone, (isc_stdtime_t)warn, now); +#if defined(STDTIME_ON_32BITS) + else + dns_zone_log(zone, ISC_LOG_ERROR, + "key expiry warning time out of range"); +#endif + } failure: if (node != NULL) dns_db_detachnode(db, &node); @@ -12188,45 +12203,45 @@ sync_secure_journal(dns_zone_t *zone, dns_journal_t *journal, isc_uint32_t start, isc_uint32_t end, dns_difftuple_t **soatuplep, dns_diff_t *diff) { - isc_result_t result; - dns_difftuple_t *tuple = NULL; + isc_result_t result; + dns_difftuple_t *tuple = NULL; dns_diffop_t op = DNS_DIFFOP_ADD; int n_soa = 0; REQUIRE(soatuplep != NULL); - if (start == end) + if (start == end) return (DNS_R_UNCHANGED); CHECK(dns_journal_iter_init(journal, start, end)); for (result = dns_journal_first_rr(journal); - result == ISC_R_SUCCESS; + result == ISC_R_SUCCESS; result = dns_journal_next_rr(journal)) { - dns_name_t *name = NULL; - isc_uint32_t ttl; - dns_rdata_t *rdata = NULL; + dns_name_t *name = NULL; + isc_uint32_t ttl; + dns_rdata_t *rdata = NULL; dns_journal_current_rr(journal, &name, &ttl, &rdata); - - if (rdata->type == dns_rdatatype_soa) { - n_soa++; - if (n_soa == 2) { - /* + + if (rdata->type == dns_rdatatype_soa) { + n_soa++; + if (n_soa == 2) { + /* * Save the latest raw SOA record. - */ - if (*soatuplep != NULL) - dns_difftuple_free(soatuplep); + */ + if (*soatuplep != NULL) + dns_difftuple_free(soatuplep); CHECK(dns_difftuple_create(diff->mctx, - DNS_DIFFOP_ADD, - name, ttl, rdata, - soatuplep)); - } - if (n_soa == 3) - n_soa = 1; + DNS_DIFFOP_ADD, + name, ttl, rdata, + soatuplep)); + } + if (n_soa == 3) + n_soa = 1; continue; } - /* Sanity. */ + /* Sanity. */ if (n_soa == 0) { dns_zone_log(zone->raw, ISC_LOG_ERROR, "corrupt journal file: '%s'\n", @@ -12251,8 +12266,8 @@ sync_secure_journal(dns_zone_t *zone, dns_journal_t *journal, &tuple)); dns_diff_appendminimal(diff, &tuple); } - if (result == ISC_R_NOMORE) - result = ISC_R_SUCCESS; + if (result == ISC_R_NOMORE) + result = ISC_R_SUCCESS; failure: return(result); @@ -12457,7 +12472,7 @@ receive_secure_serial(isc_task_t *task, isc_event_t *event) { static isc_result_t zone_send_secureserial(dns_zone_t *zone, isc_boolean_t locked, - isc_uint32_t serial) + isc_uint32_t serial) { isc_event_t *e; dns_zone_t *dummy = NULL; @@ -12474,6 +12489,7 @@ zone_send_secureserial(dns_zone_t *zone, isc_boolean_t locked, else dns_zone_iattach(zone->secure, &dummy); isc_task_send(zone->secure->task, &e); + DNS_ZONE_CLRFLAG(zone, DNS_ZONEFLG_SENDSECURE); return (ISC_R_SUCCESS); } @@ -12561,11 +12577,18 @@ receive_secure_db(isc_task_t *task, isc_event_t *event) { } dns_db_closeversion(db, &version, ISC_TRUE); + /* + * Lock hierachy zmgr, raw, zone. + */ + if (inline_secure(zone)) + LOCK_ZONE(zone->raw); LOCK_ZONE(zone); DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_NEEDNOTIFY); result = zone_postload(zone, db, loadtime, ISC_R_SUCCESS); zone_needdump(zone, 0); /* XXXMPA */ UNLOCK_ZONE(zone); + if (inline_secure(zone)) + UNLOCK_ZONE(zone->raw); failure: if (result != ISC_R_SUCCESS) @@ -13088,6 +13111,11 @@ zone_loaddone(void *arg, isc_result_t result) { (result == ISC_R_SUCCESS || result == DNS_R_SEENINCLUDE)) result = tresult; + /* + * Lock hierachy zmgr, raw, zone. + */ + if (inline_secure(zone)) + LOCK_ZONE(zone->raw); LOCK_ZONE(load->zone); (void)zone_postload(load->zone, load->db, load->loadtime, result); zonemgr_putio(&load->zone->readio); @@ -13101,6 +13129,8 @@ zone_loaddone(void *arg, isc_result_t result) { zone->update_disabled = ISC_FALSE; DNS_ZONE_CLRFLAG(load->zone, DNS_ZONEFLG_THAW); UNLOCK_ZONE(load->zone); + if (inline_secure(zone)) + UNLOCK_ZONE(zone->raw); load->magic = 0; dns_db_detach(&load->db); @@ -13876,7 +13906,7 @@ dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones) { zmgr->zonetasks = pool; pool = NULL; - if (zmgr->loadtasks == NULL) + if (zmgr->loadtasks == NULL) result = isc_taskpool_create(zmgr->taskmgr, zmgr->mctx, ntasks, 2, &pool); else @@ -15632,9 +15662,16 @@ dns_zone_dlzpostload(dns_zone_t *zone, dns_db_t *db) isc_result_t result; TIME_NOW(&loadtime); + /* + * Lock hierachy zmgr, raw, zone. + */ + if (inline_secure(zone)) + LOCK_ZONE(zone->raw); LOCK_ZONE(zone); result = zone_postload(zone, db, loadtime, ISC_R_SUCCESS); UNLOCK_ZONE(zone); + if (inline_secure(zone)) + UNLOCK_ZONE(zone->raw); return result; } @@ -15675,22 +15712,63 @@ dns_zone_getserialupdatemethod(dns_zone_t *zone) { return(zone->updatemethod); } -void +/* + * Lock hierachy zmgr, raw, zone. + */ +isc_result_t dns_zone_link(dns_zone_t *zone, dns_zone_t *raw) { + isc_result_t result; + dns_zonemgr_t *zmgr; + REQUIRE(DNS_ZONE_VALID(zone)); + REQUIRE(zone->zmgr != NULL); + REQUIRE(zone->task != NULL); + REQUIRE(zone->loadtask != NULL); + REQUIRE(zone->raw == NULL); + REQUIRE(DNS_ZONE_VALID(raw)); + REQUIRE(raw->zmgr == NULL); + REQUIRE(raw->task == NULL); + REQUIRE(raw->loadtask == NULL); + REQUIRE(raw->secure == NULL); - LOCK(&zone->lock); - if (zone->raw != NULL) - dns_zone_detach(&zone->raw); - dns_zone_attach(raw, &zone->raw); - UNLOCK(&zone->lock); + zmgr = zone->zmgr; + RWLOCK(&zmgr->rwlock, isc_rwlocktype_write); + LOCK_ZONE(raw); + LOCK_ZONE(zone); - LOCK(&raw->lock); - if (raw->secure != NULL) - dns_zone_idetach(&raw->secure); - dns_zone_iattach(zone, &raw->secure); - UNLOCK(&raw->lock); + result = isc_timer_create(zmgr->timermgr, isc_timertype_inactive, + NULL, NULL, zone->task, zone_timer, raw, + &raw->timer); + if (result != ISC_R_SUCCESS) + goto unlock; + + /* + * The timer "holds" a iref. + */ + raw->irefs++; + INSIST(raw->irefs != 0); + + + /* dns_zone_attach(raw, &zone->raw); */ + isc_refcount_increment(&raw->erefs, NULL); + zone->raw = raw; + + /* dns_zone_iattach(zone, &raw->secure); */ + zone_iattach(zone, &raw->secure); + + isc_task_attach(zone->task, &raw->task); + isc_task_attach(zone->loadtask, &raw->loadtask); + + ISC_LIST_APPEND(zmgr->zones, raw, link); + raw->zmgr = zmgr; + zmgr->refs++; + + unlock: + UNLOCK_ZONE(zone); + UNLOCK_ZONE(raw); + RWUNLOCK(&zmgr->rwlock, isc_rwlocktype_write); + return (result); } void @@ -15874,14 +15952,11 @@ dns_zone_keydone(dns_zone_t *zone, const char *keystr) { else CHECK(ISC_R_FAILURE); - DE_CONST(algstr, r.base); - r.length = strlen(algstr); - result = dns_secalg_fromtext(&alg, (isc_textregion_t *) &r); - - if (result != ISC_R_SUCCESS) { - n = sscanf(algstr, "%hhd", &alg); - if (n == 0) - CHECK(result); + n = sscanf(algstr, "%hhd", &alg); + if (n == 0) { + DE_CONST(algstr, r.base); + r.length = strlen(algstr); + CHECK(dns_secalg_fromtext(&alg, &r)); } /* construct a private-type rdata */ diff --git a/lib/irs/api b/lib/irs/api index 3d2fa6ef..a45a6bff 100644 --- a/lib/irs/api +++ b/lib/irs/api @@ -1,3 +1,8 @@ +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 LIBINTERFACE = 90 LIBREVISION = 0 LIBAGE = 0 diff --git a/lib/isc/api b/lib/isc/api index 2a59ac92..8a3bcf60 100644 --- a/lib/isc/api +++ b/lib/isc/api @@ -1,3 +1,8 @@ -LIBINTERFACE = 90 -LIBREVISION = 2 -LIBAGE = 0 +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 +LIBINTERFACE = 91 +LIBREVISION = 0 +LIBAGE = 1 diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h index cc591dc3..e6d46c9d 100644 --- a/lib/isc/include/isc/result.h +++ b/lib/isc/include/isc/result.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2009, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.h,v 1.73 2009-09-02 23:48:03 tbox Exp $ */ +/* $Id: result.h,v 1.75 2012-01-27 23:46:59 tbox Exp $ */ #ifndef ISC_RESULT_H #define ISC_RESULT_H 1 @@ -87,9 +87,10 @@ #define ISC_R_MAXSIZE 58 /*%< max size */ #define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */ #define ISC_R_BADBASE32 60 /*%< bad base32 encoding */ +#define ISC_R_UNSET 61 /*%< unset */ /*% Not a result code: the number of results. */ -#define ISC_R_NRESULTS 61 +#define ISC_R_NRESULTS 62 ISC_LANG_BEGINDECLS diff --git a/lib/isc/result.c b/lib/isc/result.c index fcb52952..67971d23 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2008, 2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2001, 2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: result.c,v 1.71 2008-09-25 04:02:39 tbox Exp $ */ +/* $Id: result.c,v 1.73 2012-01-27 23:46:59 tbox Exp $ */ /*! \file */ @@ -102,6 +102,7 @@ static const char *text[ISC_R_NRESULTS] = { "max size", /*%< 58 */ "invalid address format", /*%< 59 */ "bad base32 encoding", /*%< 60 */ + "unset", /*%< 61 */ }; #define ISC_RESULT_RESULTSET 2 diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index e24d887d..2bf09159 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2011 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1998-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: socket.c,v 1.349 2011-11-29 01:03:47 marka Exp $ */ +/* $Id: socket.c,v 1.351 2012-01-27 23:46:59 tbox Exp $ */ /*! \file */ @@ -1595,7 +1595,7 @@ allocate_socketevent(isc__socket_t *sock, isc_eventtype_t eventtype, if (ev == NULL) return (NULL); - ev->result = ISC_R_UNEXPECTED; + ev->result = ISC_R_UNSET; ISC_LINK_INIT(ev, ev_link); ISC_LIST_INIT(ev->bufferlist); ev->region.base = NULL; @@ -2048,8 +2048,6 @@ allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type, if (sock == NULL) return (ISC_R_NOMEMORY); - result = ISC_R_UNEXPECTED; - sock->common.magic = 0; sock->common.impmagic = 0; sock->references = 0; @@ -2078,8 +2076,10 @@ allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type, sock->recvcmsgbuflen = cmsgbuflen; if (sock->recvcmsgbuflen != 0U) { sock->recvcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); - if (sock->recvcmsgbuf == NULL) + if (sock->recvcmsgbuf == NULL) { + result = ISC_R_NOMEMORY; goto error; + } } cmsgbuflen = 0; @@ -2096,8 +2096,10 @@ allocate_socket(isc__socketmgr_t *manager, isc_sockettype_t type, sock->sendcmsgbuflen = cmsgbuflen; if (sock->sendcmsgbuflen != 0U) { sock->sendcmsgbuf = isc_mem_get(manager->mctx, cmsgbuflen); - if (sock->sendcmsgbuf == NULL) + if (sock->sendcmsgbuf == NULL) { + result = ISC_R_NOMEMORY; goto error; + } } memset(sock->name, 0, sizeof(sock->name)); @@ -2235,7 +2237,9 @@ clear_bsdcompat(void) { static isc_result_t opensocket(isc__socketmgr_t *manager, isc__socket_t *sock, - isc__socket_t *dup_socket) { + isc__socket_t *dup_socket) +{ + isc_result_t result; char strbuf[ISC_STRERRORSIZE]; const char *err = "socket"; int tries = 0; @@ -2350,9 +2354,10 @@ opensocket(isc__socketmgr_t *manager, isc__socket_t *sock, if (dup_socket != NULL) goto setup_done; - if (make_nonblock(sock->fd) != ISC_R_SUCCESS) { + result = make_nonblock(sock->fd); + if (result != ISC_R_SUCCESS) { (void)close(sock->fd); - return (ISC_R_UNEXPECTED); + return (result); } #ifdef SO_BSDCOMPAT @@ -3247,10 +3252,12 @@ internal_accept(isc_task_t *me, isc_event_t *ev) { UNLOCK(&sock->lock); - if (fd != -1 && (make_nonblock(fd) != ISC_R_SUCCESS)) { - (void)close(fd); - fd = -1; - result = ISC_R_UNEXPECTED; + if (fd != -1) { + result = make_nonblock(fd); + if (result != ISC_R_SUCCESS) { + (void)close(fd); + fd = -1; + } } /* @@ -4609,7 +4616,7 @@ isc__socket_recv2(isc_socket_t *sock0, isc_region_t *region, isc__socket_t *sock = (isc__socket_t *)sock0; event->ev_sender = sock; - event->result = ISC_R_UNEXPECTED; + event->result = ISC_R_UNSET; ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; @@ -4823,7 +4830,7 @@ isc__socket_sendto2(isc_socket_t *sock0, isc_region_t *region, if ((flags & ISC_SOCKFLAG_NORETRY) != 0) REQUIRE(sock->type == isc_sockettype_udp); event->ev_sender = sock; - event->result = ISC_R_UNEXPECTED; + event->result = ISC_R_UNSET; ISC_LIST_INIT(event->bufferlist); event->region = *region; event->n = 0; diff --git a/lib/isccc/api b/lib/isccc/api index 3d2fa6ef..a45a6bff 100644 --- a/lib/isccc/api +++ b/lib/isccc/api @@ -1,3 +1,8 @@ +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 LIBINTERFACE = 90 LIBREVISION = 0 LIBAGE = 0 diff --git a/lib/isccfg/api b/lib/isccfg/api index 6404d993..59e4f66c 100644 --- a/lib/isccfg/api +++ b/lib/isccfg/api @@ -1,3 +1,8 @@ +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 LIBINTERFACE = 90 LIBREVISION = 1 LIBAGE = 0 diff --git a/lib/lwres/api b/lib/lwres/api index 3d2fa6ef..a45a6bff 100644 --- a/lib/lwres/api +++ b/lib/lwres/api @@ -1,3 +1,8 @@ +# LIBINTERFACE ranges +# 9.6: 50-59, 110-119 +# 9.7: 60-79 +# 9.8: 80-89 +# 9.9: 90-109 LIBINTERFACE = 90 LIBREVISION = 0 LIBAGE = 0 |