From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 09:49:29 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48991065676; Mon, 28 May 2012 09:49:29 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC51A8FC15; Mon, 28 May 2012 09:49:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4S9nTWq003106; Mon, 28 May 2012 09:49:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4S9nTFK003083; Mon, 28 May 2012 09:49:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201205280949.q4S9nTFK003083@svn.freebsd.org> From: Doug Barton Date: Mon, 28 May 2012 09:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236171 - in vendor/bind9/dist: . bin/named bin/named/unix lib/bind9 lib/dns lib/dns/include/dns lib/dns/rdata/generic lib/isc/pthreads lib/isccfg X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 09:49:29 -0000 Author: dougb Date: Mon May 28 09:49:28 2012 New Revision: 236171 URL: http://svn.freebsd.org/changeset/base/236171 Log: Vendor import of BIND 9.8.3 Added: vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.c (contents, props changed) vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.h (contents, props changed) Modified: vendor/bind9/dist/CHANGES vendor/bind9/dist/README vendor/bind9/dist/bin/named/builtin.c vendor/bind9/dist/bin/named/query.c vendor/bind9/dist/bin/named/server.c vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c vendor/bind9/dist/lib/bind9/api vendor/bind9/dist/lib/bind9/check.c vendor/bind9/dist/lib/dns/api vendor/bind9/dist/lib/dns/dnssec.c vendor/bind9/dist/lib/dns/include/dns/ecdb.h vendor/bind9/dist/lib/dns/include/dns/rpz.h vendor/bind9/dist/lib/dns/include/dns/sdb.h vendor/bind9/dist/lib/dns/include/dns/stats.h vendor/bind9/dist/lib/dns/include/dns/tsec.h vendor/bind9/dist/lib/dns/include/dns/view.h vendor/bind9/dist/lib/dns/rbtdb.c vendor/bind9/dist/lib/dns/resolver.c vendor/bind9/dist/lib/dns/sdb.c vendor/bind9/dist/lib/dns/tkey.c vendor/bind9/dist/lib/dns/zone.c vendor/bind9/dist/lib/isc/pthreads/mutex.c vendor/bind9/dist/lib/isccfg/api vendor/bind9/dist/lib/isccfg/parser.c vendor/bind9/dist/version Modified: vendor/bind9/dist/CHANGES ============================================================================== --- vendor/bind9/dist/CHANGES Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/CHANGES Mon May 28 09:49:28 2012 (r236171) @@ -1,3 +1,56 @@ + --- 9.8.3 released --- + +3318. [tuning] Reduce the amount of work performed while holding a + bucket lock when finshed with a fetch context. + [RT #29239] + +3314. [bug] The masters list could be updated while refesh_callback + and stub_callback were using it. [RT #26732] + +3313. [protocol] Add TLSA record type. [RT #28989] + +3312. [bug] named-checkconf didn't detect a bad dns64 clients acl. + [RT #27631] + +3311. [bug] Abort the zone dump if zone->db is NULL in + zone.c:zone_gotwritehandle. [RT #29028] + +3310. [test] Increase table size for mutex profiling. [RT #28809] + +3309. [bug] resolver.c:fctx_finddone() was not threadsafe. + [RT #27995] + +3307. [bug] Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS. + [RT #28956] + +3306. [bug] Improve DNS64 reverse zone performance. [RT #28563] + +3305. [func] Add wire format lookup method to sdb. [RT #28563] + +3304. [bug] Use hmctx, not mctx when freeing rbtdb->heaps. + [RT #28571] + +3302. [bug] dns_dnssec_findmatchingkeys could fail to find + keys if the zone name contained character that + required special mappings. [RT #28600] + +3301. [contrib] Update queryperf to build on darwin. Add -R flag + for non-recursive queries. [RT #28565] + +3300. [bug] Named could die if gssapi was enabled in named.conf + but was not compiled in. [RT #28338] + +3299. [bug] Make SDB handle errors from database drivers better. + [RT #28534] + +3232. [bug] Zero zone->curmaster before return in + dns_zone_setmasterswithkeys(). [RT #26732] + +3183. [bug] Added RTLD_GLOBAL flag to dlopen call. [RT #26301] + +3197. [bug] Don't try to log the filename and line number when + the config parser can't open a file. [RT #22263] + --- 9.8.2 released --- 3298. [bug] Named could dereference a NULL pointer in @@ -58,9 +111,9 @@ 3274. [bug] Log when a zone is not reusable. Only set loadtime on successful loads. [RT #27650] -3273. [bug] AAAA responses could be returned in the additional - section even when filter-aaaa-on-v4 was in use. - [RT #27292] +3273. [bug] AAAA responses could be returned in the additional + section even when filter-aaaa-on-v4 was in use. + [RT #27292] 3271. [port] darwin: mksymtbl is not always stable, loop several times before giving up. mksymtbl was using non Modified: vendor/bind9/dist/README ============================================================================== --- vendor/bind9/dist/README Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/README Mon May 28 09:49:28 2012 (r236171) @@ -51,6 +51,10 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.8.3 + + BIND 9.8.3 is a maintenance release. + BIND 9.8.2 BIND 9.8.2 includes a number of bug fixes and prevents a security Modified: vendor/bind9/dist/bin/named/builtin.c ============================================================================== --- vendor/bind9/dist/bin/named/builtin.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/bin/named/builtin.c Mon May 28 09:49:28 2012 (r236171) @@ -69,35 +69,79 @@ static builtin_t empty_builtin = { do_em static builtin_t dns64_builtin = { do_dns64_lookup, NULL, NULL }; static dns_sdbimplementation_t *builtin_impl; +static dns_sdbimplementation_t *dns64_impl; -static const char hex[] = "0123456789abcdef"; -static const char HEX[] = "0123456789ABCDEF"; +/* + * Pre computed HEX * 16 or 1 table. + */ +static const unsigned char hex16[256] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*00*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*10*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*20*/ + 0, 16, 32, 48, 64, 80, 96,112,128,144, 1, 1, 1, 1, 1, 1, /*30*/ + 1,160,176,192,208,224,240, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*40*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*50*/ + 1,160,176,192,208,224,240, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*60*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*70*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*80*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*90*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*A0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*B0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*C0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*D0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /*E0*/ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /*F0*/ +}; + +const unsigned char decimal[] = "0123456789"; + +static size_t +dns64_rdata(unsigned char *v, size_t start, unsigned char *rdata) { + size_t i, j = 0; + + for (i = 0; i < 4; i++) { + unsigned char c = v[start++]; + if (start == 7) + start++; + if (c > 99) { + rdata[j++] = 3; + rdata[j++] = decimal[c/100]; c = c % 100; + rdata[j++] = decimal[c/10]; c = c % 10; + rdata[j++] = decimal[c]; + } else if (c > 9) { + rdata[j++] = 2; + rdata[j++] = decimal[c/10]; c = c % 10; + rdata[j++] = decimal[c]; + } else { + rdata[j++] = 1; + rdata[j++] = decimal[c]; + } + } + memcpy(&rdata[j], "\07in-addr\04arpa", 14); + return (j + 14); +} static isc_result_t -dns64_cname(const char *zone, const char *name, dns_sdblookup_t *lookup) { - size_t zlen, nlen, j; - const char *s; - unsigned char v[16]; +dns64_cname(const dns_name_t *zone, const dns_name_t *name, + dns_sdblookup_t *lookup) +{ + size_t zlen, nlen, j, len; + unsigned char v[16], n; unsigned int i; - char reverse[sizeof("123.123.123.123.in-addr.arpa.")]; + unsigned char rdata[sizeof("123.123.123.123.in-addr.arpa.")]; + unsigned char *ndata; /* - * The sum the length of the relative name and the length of the zone - * name for a IPv6 reverse lookup comes to 71. - * - * The reverse of 2001::10.0.0.1 (dns64 2001::/96) has a zone of - * "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.2.ip6.arpa" - * and a name of "1.0.0.0.0.0.a.0". The sum of the lengths of these - * two strings is 71. + * The combined length of the zone and name is 74. * - * The minimum length for a ip6.arpa zone name is 8. + * The minimum zone length is 10 ((3)ip6(4)arpa(0)). * - * The length of name should always be odd as we are expecting + * The length of name should always be even as we are expecting * a series of nibbles. */ - zlen = strlen(zone); - nlen = strlen(name); - if ((zlen + nlen) > 71U || zlen < 8U || (nlen % 2) != 1U) + zlen = zone->length; + nlen = name->length; + if ((zlen + nlen) > 74U || zlen < 10U || (nlen % 2) != 0U) return (ISC_R_NOTFOUND); /* @@ -116,25 +160,20 @@ dns64_cname(const char *zone, const char * are byte aligned and we correctly return ISC_R_NOTFOUND or * ISC_R_SUCCESS. We will not generate a CNAME in this case. */ - i = (nlen % 4) == 1U ? 1 : 0; + ndata = name->ndata; + i = (nlen % 4) == 2U ? 1 : 0; j = nlen; memset(v, 0, sizeof(v)); - while (j >= 1U) { + while (j != 0) { INSIST((i/2) < sizeof(v)); - if (j > 1U && name[1] != '.') + if (ndata[0] != 1) return (ISC_R_NOTFOUND); - v[i/2] >>= 4; - if ((s = strchr(hex, name[0])) != NULL) - v[i/2] |= (s - hex) << 4; - else if ((s = strchr(HEX, name[0])) != NULL) - v[i/2] |= (s - HEX) << 4; - else + n = hex16[ndata[1]&0xff]; + if (n == 1) return (ISC_R_NOTFOUND); - if (j > 1U) - j -= 2; - else - j -= 1; - name += 2; + v[i/2] = n | (v[i/2]>>4); + j -= 2; + ndata += 2; i++; } @@ -144,90 +183,91 @@ dns64_cname(const char *zone, const char * it corresponds to a empty node in the zone or there should be * a CNAME. */ +#define ZLEN(x) (10 + (x)/2) switch (zlen) { - case 24: /* prefix len 32 */ + case ZLEN(32): /* prefix len 32 */ + /* + * The nibbles that map to this byte must be zero for 'name' + * to exist in the zone. + */ + if (nlen > 16U && v[(nlen-1)/4 - 4] != 0) + return (ISC_R_NOTFOUND); /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[8], v[9], v[10], v[11]); + len = dns64_rdata(v, 8, rdata); break; - case 28: /* prefix len 40 */ + case ZLEN(40): /* prefix len 40 */ /* * The nibbles that map to this byte must be zero for 'name' * to exist in the zone. */ - if (nlen > 11U && v[nlen/4 - 3] != 0) + if (nlen > 12U && v[(nlen-1)/4 - 3] != 0) return (ISC_R_NOTFOUND); /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[6], v[8], v[9], v[10]); + len = dns64_rdata(v, 6, rdata); break; - case 32: /* prefix len 48 */ + case ZLEN(48): /* prefix len 48 */ /* * The nibbles that map to this byte must be zero for 'name' * to exist in the zone. */ - if (nlen > 7U && v[nlen/4 - 2] != 0) + if (nlen > 8U && v[(nlen-1)/4 - 2] != 0) return (ISC_R_NOTFOUND); /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[5], v[6], v[8], v[9]); + len = dns64_rdata(v, 5, rdata); break; - case 36: /* prefix len 56 */ + case ZLEN(56): /* prefix len 56 */ /* * The nibbles that map to this byte must be zero for 'name' * to exist in the zone. */ - if (nlen > 3U && v[nlen/4 - 1] != 0) + if (nlen > 4U && v[(nlen-1)/4 - 1] != 0) return (ISC_R_NOTFOUND); /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[4], v[5], v[6], v[8]); + len = dns64_rdata(v, 4, rdata); break; - case 40: /* prefix len 64 */ + case ZLEN(64): /* prefix len 64 */ /* * The nibbles that map to this byte must be zero for 'name' * to exist in the zone. */ - if (v[nlen/4] != 0) + if (v[(nlen-1)/4] != 0) return (ISC_R_NOTFOUND); /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[3], v[4], v[5], v[6]); + len = dns64_rdata(v, 3, rdata); break; - case 56: /* prefix len 96 */ + case ZLEN(96): /* prefix len 96 */ /* - * If the total length is not 71 then this is a empty node + * If the total length is not 74 then this is a empty node * so return success. */ - if (nlen + zlen != 71U) + if (nlen + zlen != 74U) return (ISC_R_SUCCESS); - snprintf(reverse, sizeof(reverse), "%u.%u.%u.%u.in-addr.arpa.", - v[0], v[1], v[2], v[3]); + len = dns64_rdata(v, 0, rdata); break; default: /* @@ -236,7 +276,7 @@ dns64_cname(const char *zone, const char */ return (ISC_R_NOTFOUND); } - return (dns_sdb_putrr(lookup, "CNAME", 600, reverse)); + return (dns_sdb_putrdata(lookup, dns_rdatatype_cname, 600, rdata, len)); } static isc_result_t @@ -249,13 +289,23 @@ builtin_lookup(const char *zone, const c if (strcmp(name, "@") == 0) return (b->do_lookup(lookup)); - else if (b->do_lookup == do_dns64_lookup) - return (dns64_cname(zone, name, lookup)); else return (ISC_R_NOTFOUND); } static isc_result_t +dns64_lookup(const dns_name_t *zone, const dns_name_t *name, void *dbdata, + dns_sdblookup_t *lookup) +{ + builtin_t *b = (builtin_t *) dbdata; + + if (name->labels == 0 && name->length == 0) + return (b->do_lookup(lookup)); + else + return (dns64_cname(zone, name, lookup)); +} + +static isc_result_t put_txt(dns_sdblookup_t *lookup, const char *text) { unsigned char buf[256]; unsigned int len = strlen(text); @@ -481,7 +531,17 @@ static dns_sdbmethods_t builtin_methods builtin_authority, NULL, /* allnodes */ builtin_create, - builtin_destroy + builtin_destroy, + NULL +}; + +static dns_sdbmethods_t dns64_methods = { + NULL, + builtin_authority, + NULL, /* allnodes */ + builtin_create, + builtin_destroy, + dns64_lookup, }; isc_result_t @@ -491,11 +551,17 @@ ns_builtin_init(void) { DNS_SDBFLAG_RELATIVERDATA, ns_g_mctx, &builtin_impl) == ISC_R_SUCCESS); + RUNTIME_CHECK(dns_sdb_register("_dns64", &dns64_methods, NULL, + DNS_SDBFLAG_RELATIVEOWNER | + DNS_SDBFLAG_RELATIVERDATA | + DNS_SDBFLAG_DNS64, + ns_g_mctx, &dns64_impl) + == ISC_R_SUCCESS); return (ISC_R_SUCCESS); } void ns_builtin_deinit(void) { dns_sdb_unregister(&builtin_impl); + dns_sdb_unregister(&dns64_impl); } - Modified: vendor/bind9/dist/bin/named/query.c ============================================================================== --- vendor/bind9/dist/bin/named/query.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/bin/named/query.c Mon May 28 09:49:28 2012 (r236171) @@ -3354,6 +3354,11 @@ query_addwildcardproof(ns_client_t *clie dns_name_copy(name, cname, NULL); while (result == DNS_R_NXDOMAIN) { labels = dns_name_countlabels(cname) - 1; + /* + * Sanity check. + */ + if (labels == 0U) + goto cleanup; dns_name_split(cname, labels, NULL, cname); result = dns_db_find(db, cname, version, dns_rdatatype_nsec, Modified: vendor/bind9/dist/bin/named/server.c ============================================================================== --- vendor/bind9/dist/bin/named/server.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/bin/named/server.c Mon May 28 09:49:28 2012 (r236171) @@ -1358,7 +1358,7 @@ dns64_reverse(dns_view_t *view, isc_mem_ { char *cp; char reverse[48+sizeof("ip6.arpa.")]; - const char *dns64_dbtype[4] = { "_builtin", "dns64", ".", "." }; + const char *dns64_dbtype[4] = { "_dns64", "dns64", ".", "." }; const char *sep = ": view "; const char *viewname = view->name; const unsigned char *s6; Modified: vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c ============================================================================== --- vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/bin/named/unix/dlz_dlopen_driver.c Mon May 28 09:49:28 2012 (r236171) @@ -250,7 +250,7 @@ dlopen_dlz_create(const char *dlzname, u isc_mutex_init(&cd->lock); /* Open the library */ - dlopen_flags = RTLD_NOW; + dlopen_flags = RTLD_NOW|RTLD_GLOBAL; #ifdef RTLD_DEEPBIND /* Modified: vendor/bind9/dist/lib/bind9/api ============================================================================== --- vendor/bind9/dist/lib/bind9/api Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/bind9/api Mon May 28 09:49:28 2012 (r236171) @@ -4,5 +4,5 @@ # 9.8: 80-89 # 9.9: 90-109 LIBINTERFACE = 80 -LIBREVISION = 4 +LIBREVISION = 5 LIBAGE = 0 Modified: vendor/bind9/dist/lib/bind9/check.c ============================================================================== --- vendor/bind9/dist/lib/bind9/check.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/bind9/check.c Mon May 28 09:49:28 2012 (r236171) @@ -434,7 +434,7 @@ check_dns64(cfg_aclconfctx_t *actx, cons int nbytes; int i; - static const char *acls[] = { "client", "exclude", "mapped", NULL}; + static const char *acls[] = { "clients", "exclude", "mapped", NULL}; if (voptions != NULL) cfg_map_get(voptions, "dns64", &dns64); Modified: vendor/bind9/dist/lib/dns/api ============================================================================== --- vendor/bind9/dist/lib/dns/api Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/api Mon May 28 09:49:28 2012 (r236171) @@ -4,5 +4,5 @@ # 9.8: 80-89 # 9.9: 90-109 LIBINTERFACE = 87 -LIBREVISION = 0 +LIBREVISION = 1 LIBAGE = 6 Modified: vendor/bind9/dist/lib/dns/dnssec.c ============================================================================== --- vendor/bind9/dist/lib/dns/dnssec.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/dnssec.c Mon May 28 09:49:28 2012 (r236171) @@ -1246,7 +1246,7 @@ dns_dnssec_findmatchingkeys(dns_name_t * isc_dir_init(&dir); isc_buffer_init(&b, namebuf, sizeof(namebuf) - 1); - RETERR(dns_name_totext(origin, ISC_FALSE, &b)); + RETERR(dns_name_tofilenametext(origin, ISC_FALSE, &b)); len = isc_buffer_usedlength(&b); namebuf[len] = '\0'; Modified: vendor/bind9/dist/lib/dns/include/dns/ecdb.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/ecdb.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/ecdb.h Mon May 28 09:49:28 2012 (r236171) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 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 @@ -39,6 +39,8 @@ *** Functions ***/ +ISC_LANG_BEGINDECLS + /* TBD: describe those */ isc_result_t Modified: vendor/bind9/dist/lib/dns/include/dns/rpz.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/rpz.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/rpz.h Mon May 28 09:49:28 2012 (r236171) @@ -194,5 +194,7 @@ dns_rpz_cidr_find(dns_rpz_cidr_t *cidr, dns_rpz_policy_t dns_rpz_decode_cname(dns_rdataset_t *, dns_name_t *selfname); +ISC_LANG_ENDDECLS + #endif /* DNS_RPZ_H */ Modified: vendor/bind9/dist/lib/dns/include/dns/sdb.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/sdb.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/sdb.h Mon May 28 09:49:28 2012 (r236171) @@ -59,6 +59,9 @@ typedef struct dns_sdballnodes dns_sdbal typedef isc_result_t (*dns_sdblookupfunc_t)(const char *zone, const char *name, void *dbdata, dns_sdblookup_t *); +typedef isc_result_t +(*dns_sdblookup2func_t)(const dns_name_t *zone, const dns_name_t *name, + void *dbdata, dns_sdblookup_t *lookup); typedef isc_result_t (*dns_sdbauthorityfunc_t)(const char *zone, void *dbdata, dns_sdblookup_t *); @@ -81,6 +84,7 @@ typedef struct dns_sdbmethods { dns_sdballnodesfunc_t allnodes; dns_sdbcreatefunc_t create; dns_sdbdestroyfunc_t destroy; + dns_sdblookup2func_t lookup2; } dns_sdbmethods_t; /*** @@ -92,6 +96,7 @@ ISC_LANG_BEGINDECLS #define DNS_SDBFLAG_RELATIVEOWNER 0x00000001U #define DNS_SDBFLAG_RELATIVERDATA 0x00000002U #define DNS_SDBFLAG_THREADSAFE 0x00000004U +#define DNS_SDBFLAG_DNS64 0x00000008U isc_result_t dns_sdb_register(const char *drivername, const dns_sdbmethods_t *methods, Modified: vendor/bind9/dist/lib/dns/include/dns/stats.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/stats.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/stats.h Mon May 28 09:49:28 2012 (r236171) @@ -147,6 +147,8 @@ typedef void (*dns_rdatatypestats_dumper void *); typedef void (*dns_opcodestats_dumper_t)(dns_opcode_t, isc_uint64_t, void *); +ISC_LANG_BEGINDECLS + isc_result_t dns_generalstats_create(isc_mem_t *mctx, dns_stats_t **statsp, int ncounters); /*%< Modified: vendor/bind9/dist/lib/dns/include/dns/tsec.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/tsec.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/tsec.h Mon May 28 09:49:28 2012 (r236171) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009, 2010 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2009, 2010, 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 @@ -132,4 +132,6 @@ dns_tsec_getkey(dns_tsec_t *tsec, void * *\li *tsecp points to a valid key structure depending on the TSEC type. */ +ISC_LANG_ENDDECLS + #endif /* DNS_TSEC_H */ Modified: vendor/bind9/dist/lib/dns/include/dns/view.h ============================================================================== --- vendor/bind9/dist/lib/dns/include/dns/view.h Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/include/dns/view.h Mon May 28 09:49:28 2012 (r236171) @@ -1075,4 +1075,6 @@ dns_view_setnewzones(dns_view_t *view, i void dns_view_restorekeyring(dns_view_t *view); +ISC_LANG_ENDDECLS + #endif /* DNS_VIEW_H */ Modified: vendor/bind9/dist/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist/lib/dns/rbtdb.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/rbtdb.c Mon May 28 09:49:28 2012 (r236171) @@ -7814,7 +7814,7 @@ dns_rbtdb_create for (i = 0 ; i < (int)rbtdb->node_lock_count ; i++) if (rbtdb->heaps[i] != NULL) isc_heap_destroy(&rbtdb->heaps[i]); - isc_mem_put(mctx, rbtdb->heaps, + isc_mem_put(hmctx, rbtdb->heaps, rbtdb->node_lock_count * sizeof(isc_heap_t *)); } Added: vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.c Mon May 28 09:49:28 2012 (r236171) @@ -0,0 +1,290 @@ +/* + * 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$ */ + +/* draft-ietf-dane-protocol-19.txt */ + +#ifndef RDATA_GENERIC_TLSA_52_C +#define RDATA_GENERIC_TLSA_52_C + +#define RRTYPE_TLSA_ATTRIBUTES 0 + +static inline isc_result_t +fromtext_tlsa(ARGS_FROMTEXT) { + isc_token_t token; + + REQUIRE(type == 52); + + UNUSED(type); + UNUSED(rdclass); + UNUSED(origin); + UNUSED(options); + UNUSED(callbacks); + + /* + * Certificate Usage. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Selector. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Matching type. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Certificate Association Data. + */ + return (isc_hex_tobuffer(lexer, target, -1)); +} + +static inline isc_result_t +totext_tlsa(ARGS_TOTEXT) { + isc_region_t sr; + char buf[sizeof("64000 ")]; + unsigned int n; + + REQUIRE(rdata->type == 52); + REQUIRE(rdata->length != 0); + + UNUSED(tctx); + + dns_rdata_toregion(rdata, &sr); + + /* + * Certificate Usage. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u ", n); + RETERR(str_totext(buf, target)); + + /* + * Selector. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u ", n); + RETERR(str_totext(buf, target)); + + /* + * Matching type. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u", n); + RETERR(str_totext(buf, target)); + + /* + * Certificate Association Data. + */ + if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) + RETERR(str_totext(" (", target)); + RETERR(str_totext(tctx->linebreak, target)); + if (tctx->width == 0) /* No splitting */ + RETERR(isc_hex_totext(&sr, 0, "", target)); + else + RETERR(isc_hex_totext(&sr, tctx->width - 2, + tctx->linebreak, target)); + if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) + RETERR(str_totext(" )", target)); + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +fromwire_tlsa(ARGS_FROMWIRE) { + isc_region_t sr; + + REQUIRE(type == 52); + + UNUSED(type); + UNUSED(rdclass); + UNUSED(dctx); + UNUSED(options); + + isc_buffer_activeregion(source, &sr); + + if (sr.length < 3) + return (ISC_R_UNEXPECTEDEND); + + isc_buffer_forward(source, sr.length); + return (mem_tobuffer(target, sr.base, sr.length)); +} + +static inline isc_result_t +towire_tlsa(ARGS_TOWIRE) { + isc_region_t sr; + + REQUIRE(rdata->type == 52); + REQUIRE(rdata->length != 0); + + UNUSED(cctx); + + dns_rdata_toregion(rdata, &sr); + return (mem_tobuffer(target, sr.base, sr.length)); +} + +static inline int +compare_tlsa(ARGS_COMPARE) { + isc_region_t r1; + isc_region_t r2; + + REQUIRE(rdata1->type == rdata2->type); + REQUIRE(rdata1->rdclass == rdata2->rdclass); + REQUIRE(rdata1->type == 52); + REQUIRE(rdata1->length != 0); + REQUIRE(rdata2->length != 0); + + dns_rdata_toregion(rdata1, &r1); + dns_rdata_toregion(rdata2, &r2); + return (isc_region_compare(&r1, &r2)); +} + +static inline isc_result_t +fromstruct_tlsa(ARGS_FROMSTRUCT) { + dns_rdata_tlsa_t *tlsa = source; + + REQUIRE(type == 52); + REQUIRE(source != NULL); + REQUIRE(tlsa->common.rdtype == type); + REQUIRE(tlsa->common.rdclass == rdclass); + + UNUSED(type); + UNUSED(rdclass); + + RETERR(uint8_tobuffer(tlsa->usage, target)); + RETERR(uint8_tobuffer(tlsa->selector, target)); + RETERR(uint8_tobuffer(tlsa->match, target)); + + return (mem_tobuffer(target, tlsa->data, tlsa->length)); +} + +static inline isc_result_t +tostruct_tlsa(ARGS_TOSTRUCT) { + dns_rdata_tlsa_t *tlsa = target; + isc_region_t region; + + REQUIRE(rdata->type == 52); + REQUIRE(target != NULL); + REQUIRE(rdata->length != 0); + + tlsa->common.rdclass = rdata->rdclass; + tlsa->common.rdtype = rdata->type; + ISC_LINK_INIT(&tlsa->common, link); + + dns_rdata_toregion(rdata, ®ion); + + tlsa->usage = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->selector = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->match = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->length = region.length; + + tlsa->data = mem_maybedup(mctx, region.base, region.length); + if (tlsa->data == NULL) + return (ISC_R_NOMEMORY); + + tlsa->mctx = mctx; + return (ISC_R_SUCCESS); +} + +static inline void +freestruct_tlsa(ARGS_FREESTRUCT) { + dns_rdata_tlsa_t *tlsa = source; + + REQUIRE(tlsa != NULL); + REQUIRE(tlsa->common.rdtype == 52); + + if (tlsa->mctx == NULL) + return; + + if (tlsa->data != NULL) + isc_mem_free(tlsa->mctx, tlsa->data); + tlsa->mctx = NULL; +} + +static inline isc_result_t +additionaldata_tlsa(ARGS_ADDLDATA) { + REQUIRE(rdata->type == 52); + + UNUSED(rdata); + UNUSED(add); + UNUSED(arg); + + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +digest_tlsa(ARGS_DIGEST) { + isc_region_t r; + + REQUIRE(rdata->type == 52); + + dns_rdata_toregion(rdata, &r); + + return ((digest)(arg, &r)); +} + +static inline isc_boolean_t +checkowner_tlsa(ARGS_CHECKOWNER) { + + REQUIRE(type == 52); + + UNUSED(name); + UNUSED(type); + UNUSED(rdclass); + UNUSED(wildcard); + + return (ISC_TRUE); +} + +static inline isc_boolean_t +checknames_tlsa(ARGS_CHECKNAMES) { + + REQUIRE(rdata->type == 52); + + UNUSED(rdata); + UNUSED(owner); + UNUSED(bad); + + return (ISC_TRUE); +} + +static inline int +casecompare_tlsa(ARGS_COMPARE) { + return (compare_tlsa(rdata1, rdata2)); +} + +#endif /* RDATA_GENERIC_TLSA_52_C */ Added: vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bind9/dist/lib/dns/rdata/generic/tlsa_52.h Mon May 28 09:49:28 2012 (r236171) @@ -0,0 +1,35 @@ +/* + * 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$ */ + +#ifndef GENERIC_TLSA_52_H +#define GENERIC_TLSA_52_H 1 + +/*! + * \brief per draft-ietf-dane-protocol-19.txt + */ +typedef struct dns_rdata_tlsa { + dns_rdatacommon_t common; + isc_mem_t *mctx; + isc_uint8_t usage; + isc_uint8_t selector; + isc_uint8_t match; + isc_uint16_t length; + unsigned char *data; +} dns_rdata_tlsa_t; + +#endif /* GENERIC_TLSA_52_H */ Modified: vendor/bind9/dist/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist/lib/dns/resolver.c Mon May 28 09:30:13 2012 (r236170) +++ vendor/bind9/dist/lib/dns/resolver.c Mon May 28 09:49:28 2012 (r236171) @@ -180,7 +180,9 @@ struct fetchctx { dns_rdatatype_t type; unsigned int options; unsigned int bucketnum; - char * info; + char * info; + isc_mem_t * mctx; + /*% Locked by appropriate bucket lock. */ fetchstate state; isc_boolean_t want_shutdown; @@ -446,7 +448,8 @@ static void resquery_response(isc_task_t static void resquery_connected(isc_task_t *task, isc_event_t *event); static void fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache); -static isc_boolean_t fctx_destroy(fetchctx_t *fctx); +static void fctx_destroy(fetchctx_t *fctx); +static isc_boolean_t fctx_unlink(fetchctx_t *fctx); static isc_result_t ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node, dns_rdatatype_t covers, @@ -478,8 +481,7 @@ valcreate(fetchctx_t *fctx, dns_adbaddri dns_valarg_t *valarg; isc_result_t result; - valarg = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*valarg)); + valarg = isc_mem_get(fctx->mctx, sizeof(*valarg)); if (valarg == NULL) return (ISC_R_NOMEMORY); @@ -501,8 +503,7 @@ valcreate(fetchctx_t *fctx, dns_adbaddri } ISC_LIST_APPEND(fctx->validators, validator, link); } else - isc_mem_put(fctx->res->buckets[fctx->bucketnum].mctx, - valarg, sizeof(*valarg)); + isc_mem_put(fctx->mctx, valarg, sizeof(*valarg)); return (result); } @@ -1386,13 +1387,12 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr dns_message_reset(fctx->rmessage, DNS_MESSAGE_INTENTPARSE); - query = isc_mem_get(res->buckets[fctx->bucketnum].mctx, - sizeof(*query)); + query = isc_mem_get(fctx->mctx, sizeof(*query)); if (query == NULL) { result = ISC_R_NOMEMORY; goto stop_idle_timer; } - query->mctx = res->buckets[fctx->bucketnum].mctx; + query->mctx = fctx->mctx; query->options = options; query->attributes = 0; query->sends = 0; @@ -1569,8 +1569,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr cleanup_query: if (query->connects == 0) { query->magic = 0; - isc_mem_put(res->buckets[fctx->bucketnum].mctx, - query, sizeof(*query)); + isc_mem_put(fctx->mctx, query, sizeof(*query)); } stop_idle_timer: @@ -1600,8 +1599,7 @@ add_bad_edns(fetchctx_t *fctx, isc_socka *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 09:49:59 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDA221065788; Mon, 28 May 2012 09:49:59 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF128FC17; Mon, 28 May 2012 09:49:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4S9nx4h003159; Mon, 28 May 2012 09:49:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4S9nx3r003157; Mon, 28 May 2012 09:49:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201205280949.q4S9nx3r003157@svn.freebsd.org> From: Doug Barton Date: Mon, 28 May 2012 09:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236172 - vendor/bind9/9.8.3 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 09:49:59 -0000 Author: dougb Date: Mon May 28 09:49:59 2012 New Revision: 236172 URL: http://svn.freebsd.org/changeset/base/236172 Log: Tag the 9.8.3 release Added: vendor/bind9/9.8.3/ - copied from r236171, vendor/bind9/dist/ From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 10:21:55 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 910C2106564A; Mon, 28 May 2012 10:21:55 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7836B8FC16; Mon, 28 May 2012 10:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4SALtrd006030; Mon, 28 May 2012 10:21:55 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4SALtRo006018; Mon, 28 May 2012 10:21:55 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201205281021.q4SALtRo006018@svn.freebsd.org> From: Doug Barton Date: Mon, 28 May 2012 10:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236174 - in vendor/bind9/dist-9.6: . bin/named lib/dns lib/dns/include/dns lib/dns/rdata/generic lib/isc/pthreads lib/isccfg X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 10:21:55 -0000 Author: dougb Date: Mon May 28 10:21:54 2012 New Revision: 236174 URL: http://svn.freebsd.org/changeset/base/236174 Log: Vendor import of BIND 9.6-ESV-R7 Added: vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.c (contents, props changed) vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.h (contents, props changed) Deleted: vendor/bind9/dist-9.6/release-notes.css Modified: vendor/bind9/dist-9.6/CHANGES vendor/bind9/dist-9.6/README vendor/bind9/dist-9.6/bin/named/query.c vendor/bind9/dist-9.6/lib/dns/api vendor/bind9/dist-9.6/lib/dns/include/dns/stats.h vendor/bind9/dist-9.6/lib/dns/include/dns/view.h vendor/bind9/dist-9.6/lib/dns/rbtdb.c vendor/bind9/dist-9.6/lib/dns/resolver.c vendor/bind9/dist-9.6/lib/dns/sdb.c vendor/bind9/dist-9.6/lib/dns/tkey.c vendor/bind9/dist-9.6/lib/dns/zone.c vendor/bind9/dist-9.6/lib/isc/pthreads/mutex.c vendor/bind9/dist-9.6/lib/isccfg/api vendor/bind9/dist-9.6/lib/isccfg/parser.c vendor/bind9/dist-9.6/version Modified: vendor/bind9/dist-9.6/CHANGES ============================================================================== --- vendor/bind9/dist-9.6/CHANGES Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/CHANGES Mon May 28 10:21:54 2012 (r236174) @@ -1,3 +1,43 @@ + --- 9.6-ESV-R7 released --- + +3318. [tuning] Reduce the amount of work performed while holding a + bucket lock when finshed with a fetch context. + [RT #29239] + +3314. [bug] The masters list could be updated while refesh_callback + and stub_callback were using it. [RT #26732] + +3313. [protocol] Add TLSA record type. [RT #28989] + +3311. [bug] Abort the zone dump if zone->db is NULL in + zone.c:zone_gotwritehandle. [RT #29028] + +3310. [test] Increase table size for mutex profiling. [RT #28809] + +3309. [bug] resolver.c:fctx_finddone() was not threadsafe. + [RT #27995] + +3307. [bug] Add missing ISC_LANG_BEGINDECLS and ISC_LANG_ENDDECLS. + [RT #28956] + +3304. [bug] Use hmctx, not mctx when freeing rbtdb->heaps. + [RT #28571] + +3301. [contrib] Update queryperf to build on darwin. Add -R flag + for non-recursive queries. [RT #28565] + +3300. [bug] Named could die if gssapi was enabled in named.conf + but was not compiled in. [RT #28338] + +3299. [bug] Make SDB handle errors from database drivers better. + [RT #28534] + +3232. [bug] Zero zone->curmaster before return in + dns_zone_setmasterswithkeys(). [RT #26732] + +3197. [bug] Don't try to log the filename and line number when + the config parser can't open a file. [RT #22263] + --- 9.6-ESV-R6 released --- 3298. [bug] Named could dereference a NULL pointer in @@ -168,7 +208,7 @@ 3189. [test] Added a summary report after system tests. [RT #25517] -3187. [port] win32: support for Visual Studio 2008. [RT #26356] +3187. [port] win32: support for Visual Studio 2008. [RT #26356] 3179. [port] kfreebsd: build issues. [RT #26273] @@ -201,7 +241,7 @@ an assert. [RT #25452] 3151. [bug] Queries for type RRSIG or SIG could be handled - incorrectly. [RT #21050] + incorrectly. [RT #21050] 3149. [tuning] Improve scalability by allocating one zone task per 100 zones at startup time. (The @@ -213,7 +253,7 @@ 3148. [bug] Processing of normal queries could be stalled when forwarding a UPDATE message. [RT #24711] -3146. [test] Fixed gcc4.6.0 errors in ATF. [RT #25598] +3146. [test] Fixed gcc4.6.0 errors in ATF. [RT #25598] 3145. [test] Capture output of ATF unit tests in "./atf.out" if there were any errors while running them. [RT #25527] @@ -273,10 +313,10 @@ dns_rdataset_totext() that could cause named to crash with an assertion failure. [RT #24777] -3121. [security] An authoritative name server sending a negative - response containing a very large RRset could - trigger an off-by-one error in the ncache code - and crash named. [RT #24650] +3121. [security] An authoritative name server sending a negative + response containing a very large RRset could + trigger an off-by-one error in the ncache code + and crash named. [RT #24650] 3120. [bug] Named could fail to validate zones listed in a DLV that validated insecure without using DLV and had @@ -370,9 +410,9 @@ 3043. [test] Merged in the NetBSD ATF test framework (currently version 0.12) for development of future unit tests. - Use configure --with-atf to build ATF internally - or configure --with-atf=prefix to use an external - copy. [RT #23209] + Use configure --with-atf to build ATF internally + or configure --with-atf=prefix to use an external + copy. [RT #23209] 3042. [bug] dig +trace could fail attempting to use IPv6 addresses on systems with only IPv4 connectivity. @@ -562,7 +602,7 @@ 2929. [bug] Improved handling of GSS security contexts: - added LRU expiration for generated TSIGs - added the ability to use a non-default realm - - added new "realm" keyword in nsupdate + - added new "realm" keyword in nsupdate - limited lifetime of generated keys to 1 hour or the lifetime of the context (whichever is smaller) @@ -927,11 +967,11 @@ trigger an assert. [RT #20368] 2705. [bug] Reconcile the XML stats version number with a later - BIND9 release, by adding a "name" attribute to - "cache" elements and increasing the version number - to 2.2. (This is a minor version change, but may - affect XML parsers if they assume the cache element - doesn't take an attribute.) + BIND9 release, by adding a "name" attribute to + "cache" elements and increasing the version number + to 2.2. (This is a minor version change, but may + affect XML parsers if they assume the cache element + doesn't take an attribute.) 2704. [bug] Serial of dynamic and stub zones could be inconsistent with their SOA serial. [RT #19387] @@ -1590,10 +1630,10 @@ time. [RT #18277] 2423. [security] Randomize server selection on queries, so as to - make forgery a little more difficult. Instead of - always preferring the server with the lowest RTT, - pick a server with RTT within the same 128 - millisecond band. [RT #18441] + make forgery a little more difficult. Instead of + always preferring the server with the lowest RTT, + pick a server with RTT within the same 128 + millisecond band. [RT #18441] 2422. [bug] Handle the special return value of a empty node as if it was a NXRRSET in the validator. [RT #18447] @@ -1674,7 +1714,7 @@ 2399. [placeholder] -2398. [bug] Improve file descriptor management. New, +2398. [bug] Improve file descriptor management. New, temporary, named.conf option reserved-sockets, default 512. [RT #18344] Modified: vendor/bind9/dist-9.6/README ============================================================================== --- vendor/bind9/dist-9.6/README Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/README Mon May 28 10:21:54 2012 (r236174) @@ -48,6 +48,11 @@ BIND 9 For up-to-date release notes and errata, see http://www.isc.org/software/bind9/releasenotes +BIND 9.6-ESV-R7 (Extended Support Version) + + BIND 9.4-ESV-R7 is a maintenance release, fixing bugs in BIND + 9.6-ESV-R6. + BIND 9.6-ESV-R6 (Extended Support Version) BIND 9.6-ESV-R6 includes a number of bug fixes and prevents a Modified: vendor/bind9/dist-9.6/bin/named/query.c ============================================================================== --- vendor/bind9/dist-9.6/bin/named/query.c Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/bin/named/query.c Mon May 28 10:21:54 2012 (r236174) @@ -2912,6 +2912,11 @@ query_addwildcardproof(ns_client_t *clie dns_name_copy(name, cname, NULL); while (result == DNS_R_NXDOMAIN) { labels = dns_name_countlabels(cname) - 1; + /* + * Sanity check. + */ + if (labels == 0U) + goto cleanup; dns_name_split(cname, labels, NULL, cname); result = dns_db_find(db, cname, version, dns_rdatatype_nsec, Modified: vendor/bind9/dist-9.6/lib/dns/api ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/api Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/lib/dns/api Mon May 28 10:21:54 2012 (r236174) @@ -4,5 +4,5 @@ # 9.8: 80-89 # 9.9: 90-109 LIBINTERFACE = 110 -LIBREVISION = 1 +LIBREVISION = 2 LIBAGE = 0 Modified: vendor/bind9/dist-9.6/lib/dns/include/dns/stats.h ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/include/dns/stats.h Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/lib/dns/include/dns/stats.h Mon May 28 10:21:54 2012 (r236174) @@ -147,6 +147,8 @@ typedef void (*dns_rdatatypestats_dumper void *); typedef void (*dns_opcodestats_dumper_t)(dns_opcode_t, isc_uint64_t, void *); +ISC_LANG_BEGINDECLS + isc_result_t dns_generalstats_create(isc_mem_t *mctx, dns_stats_t **statsp, int ncounters); /*%< Modified: vendor/bind9/dist-9.6/lib/dns/include/dns/view.h ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/include/dns/view.h Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/lib/dns/include/dns/view.h Mon May 28 10:21:54 2012 (r236174) @@ -878,4 +878,6 @@ dns_view_getresquerystats(dns_view_t *vi *\li 'statsp' != NULL && '*statsp' != NULL */ +ISC_LANG_ENDDECLS + #endif /* DNS_VIEW_H */ Modified: vendor/bind9/dist-9.6/lib/dns/rbtdb.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/rbtdb.c Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/lib/dns/rbtdb.c Mon May 28 10:21:54 2012 (r236174) @@ -7277,7 +7277,7 @@ dns_rbtdb_create for (i = 0 ; i < (int)rbtdb->node_lock_count ; i++) if (rbtdb->heaps[i] != NULL) isc_heap_destroy(&rbtdb->heaps[i]); - isc_mem_put(mctx, rbtdb->heaps, + isc_mem_put(hmctx, rbtdb->heaps, rbtdb->node_lock_count * sizeof(isc_heap_t *)); } Added: vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.c Mon May 28 10:21:54 2012 (r236174) @@ -0,0 +1,285 @@ +/* + * 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$ */ + +/* draft-ietf-dane-protocol-19.txt */ + +#ifndef RDATA_GENERIC_TLSA_52_C +#define RDATA_GENERIC_TLSA_52_C + +#define RRTYPE_TLSA_ATTRIBUTES 0 + +static inline isc_result_t +fromtext_tlsa(ARGS_FROMTEXT) { + isc_token_t token; + + REQUIRE(type == 52); + + UNUSED(type); + UNUSED(rdclass); + UNUSED(origin); + UNUSED(options); + UNUSED(callbacks); + + /* + * Certificate Usage. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Selector. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Matching type. + */ + RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number, + ISC_FALSE)); + if (token.value.as_ulong > 0xffU) + RETTOK(ISC_R_RANGE); + RETERR(uint8_tobuffer(token.value.as_ulong, target)); + + /* + * Certificate Association Data. + */ + return (isc_hex_tobuffer(lexer, target, -1)); +} + +static inline isc_result_t +totext_tlsa(ARGS_TOTEXT) { + isc_region_t sr; + char buf[sizeof("64000 ")]; + unsigned int n; + + REQUIRE(rdata->type == 52); + REQUIRE(rdata->length != 0); + + UNUSED(tctx); + + dns_rdata_toregion(rdata, &sr); + + /* + * Certificate Usage. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u ", n); + RETERR(str_totext(buf, target)); + + /* + * Selector. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u ", n); + RETERR(str_totext(buf, target)); + + /* + * Matching type. + */ + n = uint8_fromregion(&sr); + isc_region_consume(&sr, 1); + sprintf(buf, "%u", n); + RETERR(str_totext(buf, target)); + + /* + * Certificate Association Data. + */ + if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) + RETERR(str_totext(" (", target)); + RETERR(str_totext(tctx->linebreak, target)); + if (tctx->width == 0) /* No splitting */ + RETERR(isc_hex_totext(&sr, 0, "", target)); + else + RETERR(isc_hex_totext(&sr, tctx->width - 2, + tctx->linebreak, target)); + if ((tctx->flags & DNS_STYLEFLAG_MULTILINE) != 0) + RETERR(str_totext(" )", target)); + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +fromwire_tlsa(ARGS_FROMWIRE) { + isc_region_t sr; + + REQUIRE(type == 52); + + UNUSED(type); + UNUSED(rdclass); + UNUSED(dctx); + UNUSED(options); + + isc_buffer_activeregion(source, &sr); + + if (sr.length < 3) + return (ISC_R_UNEXPECTEDEND); + + isc_buffer_forward(source, sr.length); + return (mem_tobuffer(target, sr.base, sr.length)); +} + +static inline isc_result_t +towire_tlsa(ARGS_TOWIRE) { + isc_region_t sr; + + REQUIRE(rdata->type == 52); + REQUIRE(rdata->length != 0); + + UNUSED(cctx); + + dns_rdata_toregion(rdata, &sr); + return (mem_tobuffer(target, sr.base, sr.length)); +} + +static inline int +compare_tlsa(ARGS_COMPARE) { + isc_region_t r1; + isc_region_t r2; + + REQUIRE(rdata1->type == rdata2->type); + REQUIRE(rdata1->rdclass == rdata2->rdclass); + REQUIRE(rdata1->type == 52); + REQUIRE(rdata1->length != 0); + REQUIRE(rdata2->length != 0); + + dns_rdata_toregion(rdata1, &r1); + dns_rdata_toregion(rdata2, &r2); + return (isc_region_compare(&r1, &r2)); +} + +static inline isc_result_t +fromstruct_tlsa(ARGS_FROMSTRUCT) { + dns_rdata_tlsa_t *tlsa = source; + + REQUIRE(type == 52); + REQUIRE(source != NULL); + REQUIRE(tlsa->common.rdtype == type); + REQUIRE(tlsa->common.rdclass == rdclass); + + UNUSED(type); + UNUSED(rdclass); + + RETERR(uint8_tobuffer(tlsa->usage, target)); + RETERR(uint8_tobuffer(tlsa->selector, target)); + RETERR(uint8_tobuffer(tlsa->match, target)); + + return (mem_tobuffer(target, tlsa->data, tlsa->length)); +} + +static inline isc_result_t +tostruct_tlsa(ARGS_TOSTRUCT) { + dns_rdata_tlsa_t *tlsa = target; + isc_region_t region; + + REQUIRE(rdata->type == 52); + REQUIRE(target != NULL); + REQUIRE(rdata->length != 0); + + tlsa->common.rdclass = rdata->rdclass; + tlsa->common.rdtype = rdata->type; + ISC_LINK_INIT(&tlsa->common, link); + + dns_rdata_toregion(rdata, ®ion); + + tlsa->usage = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->selector = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->match = uint8_fromregion(®ion); + isc_region_consume(®ion, 1); + tlsa->length = region.length; + + tlsa->data = mem_maybedup(mctx, region.base, region.length); + if (tlsa->data == NULL) + return (ISC_R_NOMEMORY); + + tlsa->mctx = mctx; + return (ISC_R_SUCCESS); +} + +static inline void +freestruct_tlsa(ARGS_FREESTRUCT) { + dns_rdata_tlsa_t *tlsa = source; + + REQUIRE(tlsa != NULL); + REQUIRE(tlsa->common.rdtype == 52); + + if (tlsa->mctx == NULL) + return; + + if (tlsa->data != NULL) + isc_mem_free(tlsa->mctx, tlsa->data); + tlsa->mctx = NULL; +} + +static inline isc_result_t +additionaldata_tlsa(ARGS_ADDLDATA) { + REQUIRE(rdata->type == 52); + + UNUSED(rdata); + UNUSED(add); + UNUSED(arg); + + return (ISC_R_SUCCESS); +} + +static inline isc_result_t +digest_tlsa(ARGS_DIGEST) { + isc_region_t r; + + REQUIRE(rdata->type == 52); + + dns_rdata_toregion(rdata, &r); + + return ((digest)(arg, &r)); +} + +static inline isc_boolean_t +checkowner_tlsa(ARGS_CHECKOWNER) { + + REQUIRE(type == 52); + + UNUSED(name); + UNUSED(type); + UNUSED(rdclass); + UNUSED(wildcard); + + return (ISC_TRUE); +} + +static inline isc_boolean_t +checknames_tlsa(ARGS_CHECKNAMES) { + + REQUIRE(rdata->type == 52); + + UNUSED(rdata); + UNUSED(owner); + UNUSED(bad); + + return (ISC_TRUE); +} + +#endif /* RDATA_GENERIC_TLSA_52_C */ Added: vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/bind9/dist-9.6/lib/dns/rdata/generic/tlsa_52.h Mon May 28 10:21:54 2012 (r236174) @@ -0,0 +1,35 @@ +/* + * 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$ */ + +#ifndef GENERIC_TLSA_52_H +#define GENERIC_TLSA_52_H 1 + +/*! + * \brief per draft-ietf-dane-protocol-19.txt + */ +typedef struct dns_rdata_tlsa { + dns_rdatacommon_t common; + isc_mem_t *mctx; + isc_uint8_t usage; + isc_uint8_t selector; + isc_uint8_t match; + isc_uint16_t length; + unsigned char *data; +} dns_rdata_tlsa_t; + +#endif /* GENERIC_TLSA_52_H */ Modified: vendor/bind9/dist-9.6/lib/dns/resolver.c ============================================================================== --- vendor/bind9/dist-9.6/lib/dns/resolver.c Mon May 28 09:51:10 2012 (r236173) +++ vendor/bind9/dist-9.6/lib/dns/resolver.c Mon May 28 10:21:54 2012 (r236174) @@ -172,7 +172,9 @@ struct fetchctx { dns_rdatatype_t type; unsigned int options; unsigned int bucketnum; - char * info; + char * info; + isc_mem_t * mctx; + /*% Locked by appropriate bucket lock. */ fetchstate state; isc_boolean_t want_shutdown; @@ -436,7 +438,8 @@ static void resquery_response(isc_task_t static void resquery_connected(isc_task_t *task, isc_event_t *event); static void fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache); -static isc_boolean_t fctx_destroy(fetchctx_t *fctx); +static void fctx_destroy(fetchctx_t *fctx); +static isc_boolean_t fctx_unlink(fetchctx_t *fctx); static isc_result_t ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node, dns_rdatatype_t covers, @@ -468,8 +471,7 @@ valcreate(fetchctx_t *fctx, dns_adbaddri dns_valarg_t *valarg; isc_result_t result; - valarg = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*valarg)); + valarg = isc_mem_get(fctx->mctx, sizeof(*valarg)); if (valarg == NULL) return (ISC_R_NOMEMORY); @@ -491,8 +493,7 @@ valcreate(fetchctx_t *fctx, dns_adbaddri } ISC_LIST_APPEND(fctx->validators, validator, link); } else - isc_mem_put(fctx->res->buckets[fctx->bucketnum].mctx, - valarg, sizeof(*valarg)); + isc_mem_put(fctx->mctx, valarg, sizeof(*valarg)); return (result); } @@ -1375,13 +1376,12 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr dns_message_reset(fctx->rmessage, DNS_MESSAGE_INTENTPARSE); - query = isc_mem_get(res->buckets[fctx->bucketnum].mctx, - sizeof(*query)); + query = isc_mem_get(fctx->mctx, sizeof(*query)); if (query == NULL) { result = ISC_R_NOMEMORY; goto stop_idle_timer; } - query->mctx = res->buckets[fctx->bucketnum].mctx; + query->mctx = fctx->mctx; query->options = options; query->attributes = 0; query->sends = 0; @@ -1558,8 +1558,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddr cleanup_query: if (query->connects == 0) { query->magic = 0; - isc_mem_put(res->buckets[fctx->bucketnum].mctx, - query, sizeof(*query)); + isc_mem_put(fctx->mctx, query, sizeof(*query)); } stop_idle_timer: @@ -1589,8 +1588,7 @@ add_bad_edns(fetchctx_t *fctx, isc_socka if (bad_edns(fctx, address)) return; - sa = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*sa)); + sa = isc_mem_get(fctx->mctx, sizeof(*sa)); if (sa == NULL) return; @@ -1619,8 +1617,7 @@ add_triededns(fetchctx_t *fctx, isc_sock if (triededns(fctx, address)) return; - sa = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*sa)); + sa = isc_mem_get(fctx->mctx, sizeof(*sa)); if (sa == NULL) return; @@ -1649,8 +1646,7 @@ add_triededns512(fetchctx_t *fctx, isc_s if (triededns512(fctx, address)) return; - sa = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*sa)); + sa = isc_mem_get(fctx->mctx, sizeof(*sa)); if (sa == NULL) return; @@ -2156,8 +2152,8 @@ fctx_finddone(isc_task_t *task, isc_even isc_boolean_t want_try = ISC_FALSE; isc_boolean_t want_done = ISC_FALSE; isc_boolean_t bucket_empty = ISC_FALSE; - isc_boolean_t destroy = ISC_FALSE; unsigned int bucketnum; + isc_boolean_t destroy = ISC_FALSE; find = event->ev_sender; fctx = event->ev_arg; @@ -2195,17 +2191,14 @@ fctx_finddone(isc_task_t *task, isc_even } } else if (SHUTTINGDOWN(fctx) && fctx->pending == 0 && fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators)) { - /* - * Note that we had to wait until we had the lock before - * looking at fctx->references. - */ - if (fctx->references == 0) + + if (fctx->references == 0) { + bucket_empty = fctx_unlink(fctx); destroy = ISC_TRUE; + } } UNLOCK(&res->buckets[bucketnum].lock); - if (destroy) - bucket_empty = fctx_destroy(fctx); isc_event_free(&event); dns_adb_destroyfind(&find); @@ -2213,8 +2206,11 @@ fctx_finddone(isc_task_t *task, isc_even fctx_try(fctx, ISC_TRUE, ISC_FALSE); else if (want_done) fctx_done(fctx, ISC_R_FAILURE, __LINE__); - else if (bucket_empty) - empty_bucket(res); + else if (destroy) { + fctx_destroy(fctx); + if (bucket_empty) + empty_bucket(res); + } } @@ -2337,8 +2333,7 @@ add_bad(fetchctx_t *fctx, dns_adbaddrinf FCTXTRACE("add_bad"); - sa = isc_mem_get(fctx->res->buckets[fctx->bucketnum].mctx, - sizeof(*sa)); + sa = isc_mem_get(fctx->mctx, sizeof(*sa)); if (sa == NULL) return; *sa = *address; @@ -2689,12 +2684,9 @@ fctx_getaddresses(fetchctx_t *fctx, isc_ fctx->fwdpolicy = forwarders->fwdpolicy; if (fctx->fwdpolicy == dns_fwdpolicy_only && isstrictsubdomain(domain, &fctx->domain)) { - isc_mem_t *mctx; - - mctx = res->buckets[fctx->bucketnum].mctx; - dns_name_free(&fctx->domain, mctx); + dns_name_free(&fctx->domain, fctx->mctx); dns_name_init(&fctx->domain, NULL); - result = dns_name_dup(domain, mctx, + result = dns_name_dup(domain, fctx->mctx, &fctx->domain); if (result != ISC_R_SUCCESS) return (result); @@ -3133,10 +3125,9 @@ fctx_try(fetchctx_t *fctx, isc_boolean_t } static isc_boolean_t -fctx_destroy(fetchctx_t *fctx) { +fctx_unlink(fetchctx_t *fctx) { dns_resolver_t *res; unsigned int bucketnum; - isc_sockaddr_t *sa, *next_sa; /* * Caller must be holding the bucket lock. @@ -3153,13 +3144,42 @@ fctx_destroy(fetchctx_t *fctx) { REQUIRE(fctx->references == 0); REQUIRE(ISC_LIST_EMPTY(fctx->validators)); - FCTXTRACE("destroy"); + FCTXTRACE("unlink"); res = fctx->res; bucketnum = fctx->bucketnum; ISC_LIST_UNLINK(res->buckets[bucketnum].fctxs, fctx, link); + LOCK(&res->nlock); + res->nfctx--; + UNLOCK(&res->nlock); + + if (res->buckets[bucketnum].exiting && + ISC_LIST_EMPTY(res->buckets[bucketnum].fctxs)) + return (ISC_TRUE); + + return (ISC_FALSE); +} + +static void +fctx_destroy(fetchctx_t *fctx) { + isc_sockaddr_t *sa, *next_sa; + + REQUIRE(VALID_FCTX(fctx)); + REQUIRE(fctx->state == fetchstate_done || + fctx->state == fetchstate_init); + REQUIRE(ISC_LIST_EMPTY(fctx->events)); + REQUIRE(ISC_LIST_EMPTY(fctx->queries)); + REQUIRE(ISC_LIST_EMPTY(fctx->finds)); + REQUIRE(ISC_LIST_EMPTY(fctx->altfinds)); + REQUIRE(fctx->pending == 0); + REQUIRE(fctx->references == 0); + REQUIRE(ISC_LIST_EMPTY(fctx->validators)); + REQUIRE(!ISC_LINK_LINKED(fctx, link)); + + FCTXTRACE("destroy"); + /* * Free bad. */ @@ -3168,7 +3188,7 @@ fctx_destroy(fetchctx_t *fctx) { sa = next_sa) { next_sa = ISC_LIST_NEXT(sa, link); ISC_LIST_UNLINK(fctx->bad, sa, link); - isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa)); + isc_mem_put(fctx->mctx, sa, sizeof(*sa)); } for (sa = ISC_LIST_HEAD(fctx->edns); @@ -3176,7 +3196,7 @@ fctx_destroy(fetchctx_t *fctx) { sa = next_sa) { next_sa = ISC_LIST_NEXT(sa, link); ISC_LIST_UNLINK(fctx->edns, sa, link); - isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa)); + isc_mem_put(fctx->mctx, sa, sizeof(*sa)); } for (sa = ISC_LIST_HEAD(fctx->edns512); @@ -3184,7 +3204,7 @@ fctx_destroy(fetchctx_t *fctx) { sa = next_sa) { next_sa = ISC_LIST_NEXT(sa, link); ISC_LIST_UNLINK(fctx->edns512, sa, link); - isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa)); + isc_mem_put(fctx->mctx, sa, sizeof(*sa)); } for (sa = ISC_LIST_HEAD(fctx->bad_edns); @@ -3192,31 +3212,21 @@ fctx_destroy(fetchctx_t *fctx) { sa = next_sa) { next_sa = ISC_LIST_NEXT(sa, link); ISC_LIST_UNLINK(fctx->bad_edns, sa, link); - isc_mem_put(res->buckets[bucketnum].mctx, sa, sizeof(*sa)); + isc_mem_put(fctx->mctx, sa, sizeof(*sa)); } isc_timer_detach(&fctx->timer); dns_message_destroy(&fctx->rmessage); dns_message_destroy(&fctx->qmessage); if (dns_name_countlabels(&fctx->domain) > 0) - dns_name_free(&fctx->domain, res->buckets[bucketnum].mctx); + dns_name_free(&fctx->domain, fctx->mctx); if (dns_rdataset_isassociated(&fctx->nameservers)) dns_rdataset_disassociate(&fctx->nameservers); - dns_name_free(&fctx->name, res->buckets[bucketnum].mctx); + dns_name_free(&fctx->name, fctx->mctx); dns_db_detach(&fctx->cache); dns_adb_detach(&fctx->adb); - isc_mem_free(res->buckets[bucketnum].mctx, fctx->info); - isc_mem_put(res->buckets[bucketnum].mctx, fctx, sizeof(*fctx)); - - LOCK(&res->nlock); - res->nfctx--; - UNLOCK(&res->nlock); - - if (res->buckets[bucketnum].exiting && - ISC_LIST_EMPTY(res->buckets[bucketnum].fctxs)) - return (ISC_TRUE); - - return (ISC_FALSE); + isc_mem_free(fctx->mctx, fctx->info); + isc_mem_putanddetach(&fctx->mctx, fctx, sizeof(*fctx)); } /* @@ -3316,6 +3326,7 @@ fctx_doshutdown(isc_task_t *task, isc_ev dns_resolver_t *res; unsigned int bucketnum; dns_validator_t *validator; + isc_boolean_t destroy = ISC_FALSE; REQUIRE(VALID_FCTX(fctx)); @@ -3365,13 +3376,18 @@ fctx_doshutdown(isc_task_t *task, isc_ev } if (fctx->references == 0 && fctx->pending == 0 && - fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators)) - bucket_empty = fctx_destroy(fctx); + fctx->nqueries == 0 && ISC_LIST_EMPTY(fctx->validators)) { + bucket_empty = fctx_unlink(fctx); + destroy = ISC_TRUE; + } UNLOCK(&res->buckets[bucketnum].lock); - if (bucket_empty) - empty_bucket(res); + if (destroy) { + fctx_destroy(fctx); + if (bucket_empty) + empty_bucket(res); + } } static void @@ -3380,6 +3396,7 @@ fctx_start(isc_task_t *task, isc_event_t isc_boolean_t done = ISC_FALSE, bucket_empty = ISC_FALSE; dns_resolver_t *res; unsigned int bucketnum; + isc_boolean_t destroy = ISC_FALSE; REQUIRE(VALID_FCTX(fctx)); @@ -3412,7 +3429,8 @@ fctx_start(isc_task_t *task, isc_event_t /* * It's now safe to destroy this fctx. */ - bucket_empty = fctx_destroy(fctx); + bucket_empty = fctx_unlink(fctx); + destroy = ISC_TRUE; } done = ISC_TRUE; } else { @@ -3434,6 +3452,8 @@ fctx_start(isc_task_t *task, isc_event_t if (!done) { isc_result_t result; + INSIST(!destroy); + /* * All is well. Start working on the fetch. */ @@ -3442,8 +3462,11 @@ fctx_start(isc_task_t *task, isc_event_t fctx_done(fctx, result, __LINE__); else fctx_try(fctx, ISC_FALSE, ISC_FALSE); - } else if (bucket_empty) - empty_bucket(res); + } else if (destroy) { + fctx_destroy(fctx); + if (bucket_empty) + empty_bucket(res); + } } /* @@ -3530,27 +3553,29 @@ fctx_create(dns_resolver_t *res, dns_nam char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE]; char typebuf[DNS_RDATATYPE_FORMATSIZE]; dns_name_t suffix; + isc_mem_t *mctx; /* * Caller must be holding the lock for bucket number 'bucketnum'. */ REQUIRE(fctxp != NULL && *fctxp == NULL); - fctx = isc_mem_get(res->buckets[bucketnum].mctx, sizeof(*fctx)); + mctx = res->buckets[bucketnum].mctx; + fctx = isc_mem_get(mctx, sizeof(*fctx)); if (fctx == NULL) return (ISC_R_NOMEMORY); dns_name_format(name, buf, sizeof(buf)); dns_rdatatype_format(type, typebuf, sizeof(typebuf)); strcat(buf, "/"); /* checked */ strcat(buf, typebuf); /* checked */ - fctx->info = isc_mem_strdup(res->buckets[bucketnum].mctx, buf); + fctx->info = isc_mem_strdup(mctx, buf); if (fctx->info == NULL) { result = ISC_R_NOMEMORY; goto cleanup_fetch; } FCTXTRACE("create"); dns_name_init(&fctx->name, NULL); - result = dns_name_dup(name, res->buckets[bucketnum].mctx, &fctx->name); + result = dns_name_dup(name, mctx, &fctx->name); if (result != ISC_R_SUCCESS) goto cleanup_info; dns_name_init(&fctx->domain, NULL); @@ -3652,9 +3677,7 @@ fctx_create(dns_resolver_t *res, dns_nam NULL); if (result != ISC_R_SUCCESS) goto cleanup_name; - result = dns_name_dup(domain, - res->buckets[bucketnum].mctx, - &fctx->domain); + result = dns_name_dup(domain, mctx, &fctx->domain); if (result != ISC_R_SUCCESS) { dns_rdataset_disassociate(&fctx->nameservers); goto cleanup_name; @@ -3665,16 +3688,12 @@ fctx_create(dns_resolver_t *res, dns_nam /* * We're in forward-only mode. Set the query domain. */ - result = dns_name_dup(domain, - res->buckets[bucketnum].mctx, - &fctx->domain); + result = dns_name_dup(domain, mctx, &fctx->domain); if (result != ISC_R_SUCCESS) goto cleanup_name; } } else { - result = dns_name_dup(domain, - res->buckets[bucketnum].mctx, - &fctx->domain); + result = dns_name_dup(domain, mctx, &fctx->domain); if (result != ISC_R_SUCCESS) goto cleanup_name; dns_rdataset_clone(nameservers, &fctx->nameservers); @@ -3687,16 +3706,14 @@ fctx_create(dns_resolver_t *res, dns_nam INSIST(dns_name_issubdomain(&fctx->name, &fctx->domain)); fctx->qmessage = NULL; - result = dns_message_create(res->buckets[bucketnum].mctx, - DNS_MESSAGE_INTENTRENDER, + result = dns_message_create(mctx, DNS_MESSAGE_INTENTRENDER, &fctx->qmessage); if (result != ISC_R_SUCCESS) goto cleanup_domain; fctx->rmessage = NULL; - result = dns_message_create(res->buckets[bucketnum].mctx, - DNS_MESSAGE_INTENTPARSE, + result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &fctx->rmessage); if (result != ISC_R_SUCCESS) @@ -3746,6 +3763,8 @@ fctx_create(dns_resolver_t *res, dns_nam dns_db_attach(res->view->cachedb, &fctx->cache); fctx->adb = NULL; dns_adb_attach(res->view->adb, &fctx->adb); + fctx->mctx = NULL; + isc_mem_attach(mctx, &fctx->mctx); ISC_LIST_INIT(fctx->events); ISC_LINK_INIT(fctx, link); @@ -3769,18 +3788,18 @@ fctx_create(dns_resolver_t *res, dns_nam *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 10:22:46 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C520A106564A; Mon, 28 May 2012 10:22:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96DD28FC14; Mon, 28 May 2012 10:22:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4SAMkgw006113; Mon, 28 May 2012 10:22:46 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4SAMkWd006112; Mon, 28 May 2012 10:22:46 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201205281022.q4SAMkWd006112@svn.freebsd.org> From: Doug Barton Date: Mon, 28 May 2012 10:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236175 - vendor/bind9/9.6-ESV-R7 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 10:22:46 -0000 Author: dougb Date: Mon May 28 10:22:46 2012 New Revision: 236175 URL: http://svn.freebsd.org/changeset/base/236175 Log: Tag the 9.6-ESV-R7 release Added: vendor/bind9/9.6-ESV-R7/ - copied from r236174, vendor/bind9/dist-9.6/ From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 22:29:48 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5DB81106564A; Mon, 28 May 2012 22:29:48 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 478C58FC12; Mon, 28 May 2012 22:29:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4SMTm5k037326; Mon, 28 May 2012 22:29:48 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4SMTm7l037313; Mon, 28 May 2012 22:29:48 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205282229.q4SMTm7l037313@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 28 May 2012 22:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236206 - in vendor/byacc/dist: . package package/debian X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 22:29:48 -0000 Author: bapt Date: Mon May 28 22:29:47 2012 New Revision: 236206 URL: http://svn.freebsd.org/changeset/base/236206 Log: Vendor import of byacc 20120526 Approved by: des (mentor, implicit) Modified: vendor/byacc/dist/CHANGES vendor/byacc/dist/VERSION vendor/byacc/dist/defs.h vendor/byacc/dist/lr0.c vendor/byacc/dist/main.c vendor/byacc/dist/mkpar.c vendor/byacc/dist/output.c vendor/byacc/dist/package/byacc.spec vendor/byacc/dist/package/debian/changelog vendor/byacc/dist/reader.c vendor/byacc/dist/symtab.c vendor/byacc/dist/verbose.c Modified: vendor/byacc/dist/CHANGES ============================================================================== --- vendor/byacc/dist/CHANGES Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/CHANGES Mon May 28 22:29:47 2012 (r236206) @@ -1,3 +1,37 @@ +2012-05-26 Thomas E. Dickey + + * package/debian/changelog, package/byacc.spec, VERSION: bump + + * reader.c: + some versions of gcc may warn that bp is not set in mark_symbol, e.g., + if GCC_NORETURN is not handled; appease the compiler. + + * reader.c: + use the declared types Assoc_t and Value_t in some places where compiler only + cared about char versus short. + + * reader.c: + use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation + (no object change) + + * defs.h: + add fallbacks for GCC_NORETURN and GCC_UNUSED to make it simpler for *BSD + packagers to build without configure script. Also remove duplicate declaration + of pure_parser variable (prompted by patch by Baptiste Daroussin). + + Also define new TMALLOC and TREALLOC macros to simplify/replace MALLOC and + REALLOC macros. + + * symtab.c: + use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation + (no object change) + +2012-05-25 Thomas E. Dickey + + * output.c, main.c, verbose.c, mkpar.c, lr0.c: + use TMALLOC() and TREALLOC() macros to simplify allocation/reallocation + (no object change) + 2012-01-15 Thomas E. Dickey * package/debian/copyright: bump Modified: vendor/byacc/dist/VERSION ============================================================================== --- vendor/byacc/dist/VERSION Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/VERSION Mon May 28 22:29:47 2012 (r236206) @@ -1 +1 @@ -20120115 +20120526 Modified: vendor/byacc/dist/defs.h ============================================================================== --- vendor/byacc/dist/defs.h Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/defs.h Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: defs.h,v 1.36 2011/12/20 01:31:16 tom Exp $ */ +/* $Id: defs.h,v 1.37 2012/05/26 15:23:00 tom Exp $ */ #ifdef HAVE_CONFIG_H #include @@ -11,6 +11,10 @@ #include #include +#if defined(__cplusplus) /* __cplusplus, etc. */ +#define class myClass +#endif + #define YYMAJOR 1 #define YYMINOR 9 @@ -132,9 +136,11 @@ #define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n))) #define FREE(x) (free((char*)(x))) #define MALLOC(n) (malloc((size_t)(n))) +#define TMALLOC(t,n) ((t*) malloc((size_t)(n) * sizeof(t))) #define NEW(t) ((t*)allocate(sizeof(t))) #define NEW2(n,t) ((t*)allocate(((size_t)(n)*sizeof(t)))) #define REALLOC(p,n) (realloc((char*)(p),(size_t)(n))) +#define TREALLOC(t,p,n) ((t*)realloc((char*)(p), (size_t)(n) * sizeof(t))) #define DO_FREE(x) if (x) { FREE(x); x = 0; } @@ -302,7 +308,6 @@ extern char *nullable; extern bucket *first_symbol; extern bucket *last_symbol; -extern int pure_parser; extern int nstates; extern core *first_state; extern shifts *first_shift; @@ -343,12 +348,22 @@ extern bucket *lookup(const char *); extern bucket *make_bucket(const char *); #ifndef GCC_NORETURN +#if defined(__dead2) +#define GCC_NORETURN __dead2 +#elif defined(__dead) +#define GCC_NORETURN __dead +#else #define GCC_NORETURN /* nothing */ #endif +#endif #ifndef GCC_UNUSED +#if defined(__unused) +#define GCC_UNUSED __unused +#else #define GCC_UNUSED /* nothing */ #endif +#endif /* closure.c */ extern void closure(Value_t * nucleus, int n); @@ -422,7 +437,7 @@ extern void output(void); extern void reader(void); /* skeleton.c */ -extern void write_section(FILE *fp, const char *const section[]); +extern void write_section(FILE * fp, const char *const section[]); /* verbose.c */ extern void verbose(void); Modified: vendor/byacc/dist/lr0.c ============================================================================== --- vendor/byacc/dist/lr0.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/lr0.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: lr0.c,v 1.12 2010/06/09 08:53:17 tom Exp $ */ +/* $Id: lr0.c,v 1.13 2012/05/26 00:40:47 tom Exp $ */ #include "defs.h" @@ -538,7 +538,7 @@ set_nullable(void) int empty; int done_flag; - nullable = MALLOC(nsyms); + nullable = TMALLOC(char, nsyms); NO_SPACE(nullable); for (i = 0; i < nsyms; ++i) Modified: vendor/byacc/dist/main.c ============================================================================== --- vendor/byacc/dist/main.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/main.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.38 2012/01/14 01:01:15 tom Exp $ */ +/* $Id: main.c,v 1.39 2012/05/26 00:50:20 tom Exp $ */ #include #include /* for _exit() */ @@ -367,7 +367,7 @@ allocate(size_t n) } #define CREATE_FILE_NAME(dest, suffix) \ - dest = MALLOC(len + strlen(suffix) + 1); \ + dest = TMALLOC(char, len + strlen(suffix) + 1); \ NO_SPACE(dest); \ strcpy(dest, file_prefix); \ strcpy(dest + len, suffix) @@ -398,7 +398,7 @@ create_file_names(void) if (prefix != NULL) { len = (size_t) (prefix - output_file_name); - file_prefix = (char *)MALLOC(len + 1); + file_prefix = TMALLOC(char, len + 1); NO_SPACE(file_prefix); strncpy(file_prefix, output_file_name, len)[len] = 0; } Modified: vendor/byacc/dist/mkpar.c ============================================================================== --- vendor/byacc/dist/mkpar.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/mkpar.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: mkpar.c,v 1.11 2010/06/09 08:53:17 tom Exp $ */ +/* $Id: mkpar.c,v 1.12 2012/05/26 00:42:18 tom Exp $ */ #include "defs.h" @@ -180,7 +180,7 @@ unused_rules(void) int i; action *p; - rules_used = (Value_t *) MALLOC((unsigned)nrules * sizeof(Value_t)); + rules_used = TMALLOC(Value_t, nrules); NO_SPACE(rules_used); for (i = 0; i < nrules; ++i) Modified: vendor/byacc/dist/output.c ============================================================================== --- vendor/byacc/dist/output.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/output.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: output.c,v 1.43 2012/01/14 17:03:52 tom Exp $ */ +/* $Id: output.c,v 1.44 2012/05/26 01:13:02 tom Exp $ */ #include "defs.h" @@ -557,10 +557,10 @@ pack_vector(int vector) } while (newmax <= loc); - table = (Value_t *) REALLOC(table, (unsigned)newmax * sizeof(Value_t)); + table = TREALLOC(Value_t, table, newmax); NO_SPACE(table); - check = (Value_t *) REALLOC(check, (unsigned)newmax * sizeof(Value_t)); + check = TREALLOC(Value_t, check, newmax); NO_SPACE(check); for (l = maxtable; l < newmax; ++l) @@ -919,7 +919,7 @@ output_debug(void) ++outline; fprintf(code_file, "#define YYMAXTOKEN %d\n", max); - symnam = (const char **)MALLOC((unsigned)(max + 1) * sizeof(char *)); + symnam = TMALLOC(const char *, max + 1); NO_SPACE(symnam); /* Note that it is not necessary to initialize the element */ Modified: vendor/byacc/dist/package/byacc.spec ============================================================================== --- vendor/byacc/dist/package/byacc.spec Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/package/byacc.spec Mon May 28 22:29:47 2012 (r236206) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20120115 +%define AppVersion 20120526 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.13 2012/01/15 19:30:29 tom Exp $ +# $XTermId: byacc.spec,v 1.14 2012/05/26 16:13:45 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/debian/changelog ============================================================================== --- vendor/byacc/dist/package/debian/changelog Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/package/debian/changelog Mon May 28 22:29:47 2012 (r236206) @@ -1,3 +1,9 @@ +byacc (20120526) unstable; urgency=low + + * minor code-cleanup. + + -- Thomas E. Dickey Sat, 26 May 2012 12:14:17 -0400 + byacc (20120115) unstable; urgency=low * add testcases, improve documentation for "-s" option. Modified: vendor/byacc/dist/reader.c ============================================================================== --- vendor/byacc/dist/reader.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/reader.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: reader.c,v 1.33 2011/09/06 22:56:53 tom Exp $ */ +/* $Id: reader.c,v 1.36 2012/05/26 16:05:41 tom Exp $ */ #include "defs.h" @@ -52,7 +52,7 @@ cachec(int c) if (cinc >= cache_size) { cache_size += 256; - cache = REALLOC(cache, cache_size); + cache = TREALLOC(char, cache, cache_size); NO_SPACE(cache); } cache[cinc] = (char)c; @@ -83,7 +83,7 @@ get_line(void) if (line) FREE(line); linesize = LINESIZE + 1; - line = MALLOC(linesize); + line = TMALLOC(char, linesize); NO_SPACE(line); } @@ -100,7 +100,7 @@ get_line(void) if (++i >= linesize) { linesize += LINESIZE; - line = REALLOC(line, linesize); + line = TREALLOC(char, line, linesize); NO_SPACE(line); } c = getc(f); @@ -124,7 +124,7 @@ dup_line(void) s = line; while (*s != '\n') ++s; - p = MALLOC(s - line + 1); + p = TMALLOC(char, s - line + 1); NO_SPACE(p); s = line; @@ -684,7 +684,7 @@ copy_param(int k) if (c == '}') goto out; - buf = MALLOC(linesize); + buf = TMALLOC(char, linesize); NO_SPACE(buf); for (i = 0; (c = *cptr++) != '}'; i++) @@ -732,7 +732,7 @@ copy_param(int k) name = i + 1; - p = MALLOC(sizeof(*p)); + p = TMALLOC(param, 1); NO_SPACE(p); p->type2 = strdup(buf + type2); @@ -889,7 +889,7 @@ get_literal(void) FREE(s_line); n = cinc; - s = MALLOC(n); + s = TMALLOC(char, n); NO_SPACE(s); for (i = 0; i < n; ++i) @@ -1057,14 +1057,14 @@ get_tag(void) if (ntags >= tagmax) { tagmax += 16; - tag_table = (char **) + tag_table = (tag_table - ? REALLOC(tag_table, (unsigned)tagmax * sizeof(char *)) - : MALLOC((unsigned)tagmax * sizeof(char *))); + ? TREALLOC(char *, tag_table, tagmax) + : TMALLOC(char *, tagmax)); NO_SPACE(tag_table); } - s = MALLOC(cinc); + s = TMALLOC(char, cinc); NO_SPACE(s); strcpy(s, cache); @@ -1245,7 +1245,7 @@ read_declarations(void) int c, k; cache_size = 256; - cache = MALLOC(cache_size); + cache = TMALLOC(char, cache_size); NO_SPACE(cache); for (;;) @@ -1315,7 +1315,7 @@ initialize_grammar(void) nitems = 4; maxitems = 300; - pitem = (bucket **)MALLOC((unsigned)maxitems * sizeof(bucket *)); + pitem = TMALLOC(bucket *, maxitems); NO_SPACE(pitem); pitem[0] = 0; @@ -1326,21 +1326,21 @@ initialize_grammar(void) nrules = 3; maxrules = 100; - plhs = (bucket **)MALLOC((unsigned)maxrules * sizeof(bucket *)); + plhs = TMALLOC(bucket *, maxrules); NO_SPACE(plhs); plhs[0] = 0; plhs[1] = 0; plhs[2] = 0; - rprec = (short *)MALLOC((unsigned)maxrules * sizeof(short)); + rprec = TMALLOC(Value_t, maxrules); NO_SPACE(rprec); rprec[0] = 0; rprec[1] = 0; rprec[2] = 0; - rassoc = (char *)MALLOC((unsigned)maxrules * sizeof(char)); + rassoc = TMALLOC(Assoc_t, maxrules); NO_SPACE(rassoc); rassoc[0] = TOKEN; @@ -1352,7 +1352,7 @@ static void expand_items(void) { maxitems += 300; - pitem = (bucket **)REALLOC(pitem, (unsigned)maxitems * sizeof(bucket *)); + pitem = TREALLOC(bucket *, pitem, maxitems); NO_SPACE(pitem); } @@ -1361,13 +1361,13 @@ expand_rules(void) { maxrules += 100; - plhs = (bucket **)REALLOC(plhs, (unsigned)maxrules * sizeof(bucket *)); + plhs = TREALLOC(bucket *, plhs, maxrules); NO_SPACE(plhs); - rprec = (short *)REALLOC(rprec, (unsigned)maxrules * sizeof(short)); + rprec = TREALLOC(Value_t, rprec, maxrules); NO_SPACE(rprec); - rassoc = (char *)REALLOC(rassoc, (unsigned)maxrules * sizeof(char)); + rassoc = TREALLOC(Assoc_t, rassoc, maxrules); NO_SPACE(rassoc); } @@ -1779,7 +1779,7 @@ static int mark_symbol(void) { int c; - bucket *bp; + bucket *bp = NULL; c = cptr[1]; if (c == '%' || c == '\\') @@ -1883,7 +1883,7 @@ pack_names(void) for (bp = first_symbol; bp; bp = bp->next) name_pool_size += strlen(bp->name) + 1; - name_pool = MALLOC(name_pool_size); + name_pool = TMALLOC(char, name_pool_size); NO_SPACE(name_pool); strcpy(name_pool, "$accept"); @@ -1938,7 +1938,7 @@ protect_string(char *src, char **des) len++; } - *des = d = (char *)MALLOC(len); + *des = d = TMALLOC(char, len); NO_SPACE(d); s = src; @@ -1970,19 +1970,19 @@ pack_symbols(void) start_symbol = (Value_t) ntokens; nvars = nsyms - ntokens; - symbol_name = (char **)MALLOC((unsigned)nsyms * sizeof(char *)); + symbol_name = TMALLOC(char *, nsyms); NO_SPACE(symbol_name); - symbol_value = (short *)MALLOC((unsigned)nsyms * sizeof(short)); + symbol_value = TMALLOC(Value_t, nsyms); NO_SPACE(symbol_value); - symbol_prec = (short *)MALLOC((unsigned)nsyms * sizeof(short)); + symbol_prec = TMALLOC(short, nsyms); NO_SPACE(symbol_prec); - symbol_assoc = MALLOC(nsyms); + symbol_assoc = TMALLOC(char, nsyms); NO_SPACE(symbol_assoc); - v = (bucket **)MALLOC((unsigned)nsyms * sizeof(bucket *)); + v = TMALLOC(bucket *, nsyms); NO_SPACE(v); v[0] = 0; @@ -2082,7 +2082,7 @@ pack_symbols(void) if (gflag) { - symbol_pname = (char **)MALLOC((unsigned)nsyms * sizeof(char *)); + symbol_pname = TMALLOC(char *, nsyms); NO_SPACE(symbol_pname); for (i = 0; i < nsyms; ++i) @@ -2100,19 +2100,19 @@ pack_grammar(void) Assoc_t assoc; Value_t prec2; - ritem = (short *)MALLOC((unsigned)nitems * sizeof(short)); + ritem = TMALLOC(Value_t, nitems); NO_SPACE(ritem); - rlhs = (short *)MALLOC((unsigned)nrules * sizeof(short)); + rlhs = TMALLOC(Value_t, nrules); NO_SPACE(rlhs); - rrhs = (short *)MALLOC((unsigned)(nrules + 1) * sizeof(short)); + rrhs = TMALLOC(Value_t, nrules + 1); NO_SPACE(rrhs); - rprec = (short *)REALLOC(rprec, (unsigned)nrules * sizeof(short)); + rprec = TREALLOC(Value_t, rprec, nrules); NO_SPACE(rprec); - rassoc = REALLOC(rassoc, nrules); + rassoc = TREALLOC(Assoc_t, rassoc, nrules); NO_SPACE(rassoc); ritem[0] = -1; Modified: vendor/byacc/dist/symtab.c ============================================================================== --- vendor/byacc/dist/symtab.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/symtab.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: symtab.c,v 1.9 2010/11/24 15:12:29 tom Exp $ */ +/* $Id: symtab.c,v 1.10 2012/05/26 15:16:12 tom Exp $ */ #include "defs.h" @@ -33,13 +33,13 @@ make_bucket(const char *name) assert(name != 0); - bp = (bucket *)MALLOC(sizeof(bucket)); + bp = TMALLOC(bucket, 1); NO_SPACE(bp); bp->link = 0; bp->next = 0; - bp->name = MALLOC(strlen(name) + 1); + bp->name = TMALLOC(char, strlen(name) + 1); NO_SPACE(bp->name); bp->tag = 0; @@ -82,7 +82,7 @@ create_symbol_table(void) int i; bucket *bp; - symbol_table = (bucket **)MALLOC(TABLE_SIZE * sizeof(bucket *)); + symbol_table = TMALLOC(bucket *, TABLE_SIZE); NO_SPACE(symbol_table); for (i = 0; i < TABLE_SIZE; i++) Modified: vendor/byacc/dist/verbose.c ============================================================================== --- vendor/byacc/dist/verbose.c Mon May 28 22:09:50 2012 (r236205) +++ vendor/byacc/dist/verbose.c Mon May 28 22:29:47 2012 (r236206) @@ -1,4 +1,4 @@ -/* $Id: verbose.c,v 1.9 2010/06/09 08:58:29 tom Exp $ */ +/* $Id: verbose.c,v 1.10 2012/05/26 00:45:17 tom Exp $ */ #include "defs.h" @@ -23,7 +23,7 @@ verbose(void) if (!vflag) return; - null_rules = (short *)MALLOC((unsigned)nrules * sizeof(short)); + null_rules = TMALLOC(short, nrules); NO_SPACE(null_rules); fprintf(verbose_file, "\f\n"); From owner-svn-src-vendor@FreeBSD.ORG Mon May 28 22:30:37 2012 Return-Path: Delivered-To: svn-src-vendor@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85AF91065672; Mon, 28 May 2012 22:30:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58C158FC18; Mon, 28 May 2012 22:30:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4SMUbhC037398; Mon, 28 May 2012 22:30:37 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4SMUbHX037397; Mon, 28 May 2012 22:30:37 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201205282230.q4SMUbHX037397@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 28 May 2012 22:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236207 - vendor/byacc/20120526 X-BeenThere: svn-src-vendor@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the vendor work area tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2012 22:30:37 -0000 Author: bapt Date: Mon May 28 22:30:36 2012 New Revision: 236207 URL: http://svn.freebsd.org/changeset/base/236207 Log: Tag byacc 20120526 Added: vendor/byacc/20120526/ - copied from r236206, vendor/byacc/dist/