2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

Determine the minimum ttl from the SOA and pass it into dns_buildnxt

This commit is contained in:
Brian Wellington 2000-02-08 19:03:29 +00:00
parent ca5af3ab78
commit 201b17e55f
2 changed files with 40 additions and 4 deletions

View File

@ -722,6 +722,10 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
dns_dbiterator_t *dbiter;
isc_boolean_t atorigin = ISC_TRUE;
dns_name_t *origin;
dns_rdataset_t soaset;
dns_rdata_t soarr;
dns_rdata_soa_t soa;
dns_ttl_t zonettl;
dns_fixedname_init(&fname);
name = dns_fixedname_name(&fname);
@ -730,13 +734,27 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
dns_fixedname_init(&fcurname);
curname = dns_fixedname_name(&fcurname);
origin = dns_db_origin(db);
dns_rdataset_init(&soaset);
result = dns_db_find(db, origin, version, dns_rdatatype_soa,
0, 0, NULL, name, &soaset, NULL);
check_result(result, "dns_db_find");
result = dns_rdataset_first(&soaset);
check_result(result, "dns_rdataset_first");
dns_rdataset_current(&soaset, &soarr);
result = dns_rdata_tostruct(&soarr, &soa, mctx);
check_result(result, "dns_rdataset_tostruct");
zonettl = soa.minimum;
dns_rdata_freestruct(&soa);
dns_rdataset_disassociate(&soaset);
lastcut = NULL;
dbiter = NULL;
result = dns_db_createiterator(db, ISC_FALSE, &dbiter);
check_result(result, "dns_db_createiterator()");
result = dns_dbiterator_first(dbiter);
node = NULL;
origin = dns_db_origin(db);
dns_name_clone(origin, name);
result = next_nonglue(db, version, dbiter, name, &node, origin,
lastcut);
@ -791,7 +809,7 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
target = NULL; /* Make compiler happy. */
fatal("db iteration failed");
}
nxtresult = dns_buildnxt(db, version, node, target);
nxtresult = dns_buildnxt(db, version, node, target, zonettl);
check_result(nxtresult, "dns_buildnxt()");
signname(db, version, node, curname, atorigin);
atorigin = ISC_FALSE;

View File

@ -722,6 +722,10 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
dns_dbiterator_t *dbiter;
isc_boolean_t atorigin = ISC_TRUE;
dns_name_t *origin;
dns_rdataset_t soaset;
dns_rdata_t soarr;
dns_rdata_soa_t soa;
dns_ttl_t zonettl;
dns_fixedname_init(&fname);
name = dns_fixedname_name(&fname);
@ -730,13 +734,27 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
dns_fixedname_init(&fcurname);
curname = dns_fixedname_name(&fcurname);
origin = dns_db_origin(db);
dns_rdataset_init(&soaset);
result = dns_db_find(db, origin, version, dns_rdatatype_soa,
0, 0, NULL, name, &soaset, NULL);
check_result(result, "dns_db_find");
result = dns_rdataset_first(&soaset);
check_result(result, "dns_rdataset_first");
dns_rdataset_current(&soaset, &soarr);
result = dns_rdata_tostruct(&soarr, &soa, mctx);
check_result(result, "dns_rdataset_tostruct");
zonettl = soa.minimum;
dns_rdata_freestruct(&soa);
dns_rdataset_disassociate(&soaset);
lastcut = NULL;
dbiter = NULL;
result = dns_db_createiterator(db, ISC_FALSE, &dbiter);
check_result(result, "dns_db_createiterator()");
result = dns_dbiterator_first(dbiter);
node = NULL;
origin = dns_db_origin(db);
dns_name_clone(origin, name);
result = next_nonglue(db, version, dbiter, name, &node, origin,
lastcut);
@ -791,7 +809,7 @@ signzone(dns_db_t *db, dns_dbversion_t *version) {
target = NULL; /* Make compiler happy. */
fatal("db iteration failed");
}
nxtresult = dns_buildnxt(db, version, node, target);
nxtresult = dns_buildnxt(db, version, node, target, zonettl);
check_result(nxtresult, "dns_buildnxt()");
signname(db, version, node, curname, atorigin);
atorigin = ISC_FALSE;