lib/dns/master.c
/*
 * Convert each element from a rdatalist_t to rdataset then call commit.
 * Unlink each element as we go.
 */
Convert each element from a rdatalist_t to rdataset then call commit.
Unlink each element as we go.
Convert each element from a rdatalist_t to rdataset then call commit . Unlink each element as we go .
static isc_result_t
commit(dns_rdatacallbacks_t *callbacks, dns_loadctx_t *lctx,
       rdatalist_head_t *head, dns_name_t *owner,
       const char *source, unsigned int line)
{
	dns_rdatalist_t *this;
	dns_rdataset_t dataset;
	isc_result_t result;
	char namebuf[DNS_NAME_FORMATSIZE];
	void    (*error)(struct dns_rdatacallbacks *, const char *, ...);
	this = ISC_LIST_HEAD(*head);
	error = callbacks->error;
	if (this == NULL)
		return (ISC_R_SUCCESS);
	do {
		dns_rdataset_init(&dataset);
		RUNTIME_CHECK(dns_rdatalist_tordataset(this, &dataset)
			      == ISC_R_SUCCESS);
		dataset.trust = dns_trust_ultimate;
		if (dataset.type == dns_rdatatype_rrsig &&
		    (lctx->options & DNS_MASTER_RESIGN) != 0) {
			dataset.attributes |= DNS_RDATASETATTR_RESIGN;
			dns_name_format(owner, namebuf, sizeof(namebuf));
			dataset.resign = resign_fromlist(this, lctx->resign);
		}
		result = ((*callbacks->add)(callbacks->add_private, owner,
					    &dataset));
		if (result == ISC_R_NOMEMORY) {
			(*error)(callbacks, "dns_master_load: %s",
				 dns_result_totext(result));
		} else if (result != ISC_R_SUCCESS) {
			dns_name_format(owner, namebuf, sizeof(namebuf));
			if (source != NULL) {
				(*error)(callbacks, "%s: %s:%lu: %s: %s",
					 "dns_master_load", source, line,
					 namebuf, dns_result_totext(result));
			} else {
				(*error)(callbacks, "%s: %s: %s",
					 "dns_master_load", namebuf,
					 dns_result_totext(result));
			}
		}
		if (MANYERRS(lctx, result))
			SETRESULT(lctx, result);
		else if (result != ISC_R_SUCCESS)
			return (result);
		ISC_LIST_UNLINK(*head, this, link);
		this = ISC_LIST_HEAD(*head);
	} while (this != NULL);
	return (ISC_R_SUCCESS);
}
static isc_result_t commit ( dns_rdatacallbacks_t * callbacks , dns_loadctx_t * lctx , rdatalist_head_t * head , dns_name_t * owner , const char * source , unsigned int line ) { dns_rdatalist_t * this ; dns_rdataset_t dataset ; isc_result_t result ; char namebuf [ DNS_NAME_FORMATSIZE ] ; void ( * error ) ( struct dns_rdatacallbacks * , const char * , ... ) ; this = ISC_LIST_HEAD ( * head ) ; error = callbacks -> error ; if ( this == NULL ) return ( ISC_R_SUCCESS ) ; do { dns_rdataset_init ( & dataset ) ; RUNTIME_CHECK ( dns_rdatalist_tordataset ( this , & dataset ) == ISC_R_SUCCESS ) ; dataset . trust = dns_trust_ultimate ; if ( dataset . type == dns_rdatatype_rrsig && ( lctx -> options & DNS_MASTER_RESIGN ) != 0 ) { dataset . attributes |= DNS_RDATASETATTR_RESIGN ; dns_name_format ( owner , namebuf , sizeof ( namebuf ) ) ; dataset . resign = resign_fromlist ( this , lctx -> resign ) ; } result = ( ( * callbacks -> add ) ( callbacks -> add_private , owner , & dataset ) ) ; if ( result == ISC_R_NOMEMORY ) { ( * error ) ( callbacks , " " , dns_result_totext ( result ) ) ; } else if ( result != ISC_R_SUCCESS ) { dns_name_format ( owner , namebuf , sizeof ( namebuf ) ) ; if ( source != NULL ) { ( * error ) ( callbacks , " " , " " , source , line , namebuf , dns_result_totext ( result ) ) ; } else { ( * error ) ( callbacks , " " , " " , namebuf , dns_result_totext ( result ) ) ; } } if ( MANYERRS ( lctx , result ) ) SETRESULT ( lctx , result ) ; else if ( result != ISC_R_SUCCESS ) return ( result ) ; ISC_LIST_UNLINK ( * head , this , link ) ; this = ISC_LIST_HEAD ( * head ) ; } while ( this != NULL ) ; return ( ISC_R_SUCCESS ) ; }
Convert each element from a rdatalist_t to rdataset then call commit.
Convert each element from a rdatalist_t to rdataset then call commit .
/*
		 * If this is a secure dynamic zone set the re-signing time.
		 */