1023. [func] Accept hints without TTLs.

This commit is contained in:
Mark Andrews 2003-08-04 06:53:23 +00:00
parent d97b2b9426
commit d354545fb9
4 changed files with 30 additions and 18 deletions

View file

@ -1,3 +1,5 @@
1023. [func] Accept hints without TTLs.
1011. [cleanup] Removed isc_dir_current().
1009. [port] OpenUNIX 8 support. [RT #1728]

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.h,v 1.31.2.3 2003/07/22 04:03:45 marka Exp $ */
/* $Id: master.h,v 1.31.2.3.2.1 2003/08/04 06:53:23 marka Exp $ */
#ifndef DNS_MASTER_H
#define DNS_MASTER_H 1
@ -37,6 +37,7 @@
#define DNS_MASTER_MANYERRORS 0x00000002 /* Continue processing on errors. */
#define DNS_MASTER_NOINCLUDE 0x00000004 /* Disallow $INCLUDE directives. */
#define DNS_MASTER_ZONE 0x00000008 /* Loading a zone master file. */
#define DNS_MASTER_HINT 0x00000010 /* Loading a hint master file. */
#define DNS_MASTER_SLAVE 0x00000020 /* Loading a slave master file. */
ISC_LANG_BEGINDECLS

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.122.2.8 2003/07/22 04:03:41 marka Exp $ */
/* $Id: master.c,v 1.122.2.8.2.1 2003/08/04 06:53:22 marka Exp $ */
#include <config.h>
@ -352,7 +352,7 @@ incctx_destroy(isc_mem_t *mctx, dns_incctx_t *ictx) {
parent = ictx->parent;
ictx->parent = NULL;
isc_mem_put(mctx, ictx, sizeof *ictx);
isc_mem_put(mctx, ictx, sizeof(*ictx));
if (parent != NULL) {
ictx = parent;
@ -390,7 +390,7 @@ incctx_create(isc_mem_t *mctx, dns_name_t *origin, dns_incctx_t **ictxp) {
isc_region_t r;
int i;
ictx = isc_mem_get(mctx, sizeof *ictx);
ictx = isc_mem_get(mctx, sizeof(*ictx));
if (ictx == NULL)
return (ISC_R_NOMEMORY);
@ -446,7 +446,7 @@ loadctx_create(isc_mem_t *mctx, unsigned int options, dns_name_t *top,
return (ISC_R_NOMEMORY);
result = isc_mutex_init(&lctx->lock);
if (result != ISC_R_SUCCESS) {
isc_mem_put(mctx, lctx, sizeof *lctx);
isc_mem_put(mctx, lctx, sizeof(*lctx));
UNEXPECTED_ERROR(__FILE__, __LINE__,
"isc_mutex_init() failed: %s",
isc_result_totext(result));
@ -462,7 +462,7 @@ loadctx_create(isc_mem_t *mctx, unsigned int options, dns_name_t *top,
result = isc_lex_create(mctx, TOKENSIZ, &lctx->lex);
if (result != ISC_R_SUCCESS)
goto cleanup_inc;
memset(specials, 0, sizeof specials);
memset(specials, 0, sizeof(specials));
specials['('] = 1;
specials[')'] = 1;
specials['"'] = 1;
@ -1099,7 +1099,7 @@ load(dns_loadctx_t *lctx) {
*
* Find a free name buffer.
*/
for (new_in_use = 0; new_in_use < NBUFS ; new_in_use++)
for (new_in_use = 0; new_in_use < NBUFS; new_in_use++)
if (!ictx->in_use[new_in_use])
break;
INSIST(new_in_use < NBUFS);
@ -1455,6 +1455,13 @@ load(dns_loadctx_t *lctx) {
limit_ttl(callbacks, source, line, &lctx->ttl);
lctx->default_ttl = lctx->ttl;
lctx->default_ttl_known = ISC_TRUE;
} else if ((lctx->options & DNS_MASTER_HINT) != 0) {
/*
* Zero TTL's are fine for hints.
*/
lctx->ttl = 0;
lctx->default_ttl = lctx->ttl;
lctx->default_ttl_known = ISC_TRUE;
} else {
(*callbacks->warn)(callbacks,
"%s:%lu: no TTL specified; "
@ -1608,9 +1615,9 @@ load(dns_loadctx_t *lctx) {
ISC_LIST_UNLINK(glue_list, this, link);
if (rdatalist != NULL)
isc_mem_put(mctx, rdatalist,
rdatalist_size * sizeof *rdatalist);
rdatalist_size * sizeof(*rdatalist));
if (rdata != NULL)
isc_mem_put(mctx, rdata, rdata_size * sizeof *rdata);
isc_mem_put(mctx, rdata, rdata_size * sizeof(*rdata));
if (target_mem != NULL)
isc_mem_put(mctx, target_mem, target_size);
if (include_file != NULL)
@ -1646,7 +1653,7 @@ pushfile(const char *master_file, dns_name_t *origin, dns_loadctx_t *lctx) {
/* Set current domain. */
if (ictx->glue != NULL || ictx->current != NULL) {
for (new_in_use = 0; new_in_use < NBUFS ; new_in_use++)
for (new_in_use = 0; new_in_use < NBUFS; new_in_use++)
if (!new->in_use[new_in_use])
break;
INSIST(new_in_use < NBUFS);
@ -1876,7 +1883,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
ISC_LIST(dns_rdatalist_t) save;
dns_rdatalist_t *this;
new = isc_mem_get(mctx, new_len * sizeof *new);
new = isc_mem_get(mctx, new_len * sizeof(*new));
if (new == NULL)
return (NULL);
@ -1908,7 +1915,7 @@ grow_rdatalist(int new_len, dns_rdatalist_t *old, int old_len,
INSIST(rdlcount == old_len);
if (old != NULL)
isc_mem_put(mctx, old, old_len * sizeof *old);
isc_mem_put(mctx, old, old_len * sizeof(*old));
return (new);
}
@ -1927,10 +1934,10 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
dns_rdatalist_t *this;
dns_rdata_t *rdata;
new = isc_mem_get(mctx, new_len * sizeof *new);
new = isc_mem_get(mctx, new_len * sizeof(*new));
if (new == NULL)
return (NULL);
memset(new, 0, new_len * sizeof *new);
memset(new, 0, new_len * sizeof(*new));
/*
* Copy current relinking.
@ -1971,7 +1978,7 @@ grow_rdata(int new_len, dns_rdata_t *old, int old_len,
}
INSIST(rdcount == old_len);
if (old != NULL)
isc_mem_put(mctx, old, old_len * sizeof *old);
isc_mem_put(mctx, old, old_len * sizeof(*old));
return (new);
}

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rootns.c,v 1.20.2.3 2003/07/22 04:03:44 marka Exp $ */
/* $Id: rootns.c,v 1.20.2.3.2.1 2003/08/04 06:53:22 marka Exp $ */
#include <config.h>
@ -215,14 +215,16 @@ dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
* Load the hints from the specified filename.
*/
result = dns_master_loadfile(filename, &db->origin,
&db->origin, db->rdclass, 0,
&db->origin, db->rdclass,
DNS_MASTER_HINT,
&callbacks, db->mctx);
} else if (rdclass == dns_rdataclass_in) {
/*
* Default to using the Internet root servers.
*/
result = dns_master_loadbuffer(&source, &db->origin,
&db->origin, db->rdclass, 0,
&db->origin, db->rdclass,
DNS_MASTER_HINT,
&callbacks, db->mctx);
} else
result = ISC_R_NOTFOUND;