From 96ea98af241ef00395f4e61de7e2dacfd9941afc Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sun, 30 Sep 2001 04:31:28 +0000 Subject: [PATCH] 1023. [func] Accept hints without TTLs. --- CHANGES | 2 ++ lib/dns/include/dns/master.h | 3 ++- lib/dns/master.c | 9 ++++++++- lib/dns/rootns.c | 8 +++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 9cdbff3a12..dac3193a82 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1023. [func] Accept hints without TTLs. + 1022. [bug] Allow hints to be completely empty. [RT #1802] 1021 [bug] Win32 timestamp was one month later than it should diff --git a/lib/dns/include/dns/master.h b/lib/dns/include/dns/master.h index 2e9f5ed529..3347ce840a 100644 --- a/lib/dns/include/dns/master.h +++ b/lib/dns/include/dns/master.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.h,v 1.32 2001/09/04 00:35:19 marka Exp $ */ +/* $Id: master.h,v 1.33 2001/09/30 04:31:28 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. */ ISC_LANG_BEGINDECLS diff --git a/lib/dns/master.c b/lib/dns/master.c index bbbee07773..50bbafec93 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.c,v 1.126 2001/09/11 05:09:41 marka Exp $ */ +/* $Id: master.c,v 1.127 2001/09/30 04:31:26 marka Exp $ */ #include @@ -1449,6 +1449,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; " diff --git a/lib/dns/rootns.c b/lib/dns/rootns.c index c9b6193f88..a3da388af6 100644 --- a/lib/dns/rootns.c +++ b/lib/dns/rootns.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rootns.c,v 1.21 2001/09/30 03:02:47 marka Exp $ */ +/* $Id: rootns.c,v 1.22 2001/09/30 04:31:27 marka Exp $ */ #include @@ -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;