Compare commits
4 Commits
5246-fix-d
...
each-exp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3878c145c9 | ||
|
|
4acbfbc2d1 | ||
|
|
1ef9a32de7 | ||
|
|
6c738fe323 |
@@ -567,6 +567,14 @@ import_rdataset(dns_adbname_t *adbname, dns_rdataset_t *rdataset,
|
|||||||
rdataset->ttl = ttlclamp(rdataset->ttl);
|
rdataset->ttl = ttlclamp(rdataset->ttl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rdtype != dns_rdatatype_a && rdtype != dns_rdatatype_aaaa) {
|
||||||
|
char rb[DNS_RDATATYPE_FORMATSIZE];
|
||||||
|
char nb[DNS_NAME_FORMATSIZE];
|
||||||
|
dns_rdatatype_format(rdtype, rb, sizeof(rb));
|
||||||
|
dns_name_format(adbname->name, nb, sizeof(nb));
|
||||||
|
isc_log_write(DNS_LOGCATEGORY_RESOLVER, DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE,
|
||||||
|
"%s has %s", nb, rb);
|
||||||
|
}
|
||||||
REQUIRE(rdtype == dns_rdatatype_a || rdtype == dns_rdatatype_aaaa);
|
REQUIRE(rdtype == dns_rdatatype_a || rdtype == dns_rdatatype_aaaa);
|
||||||
|
|
||||||
for (result = dns_rdataset_first(rdataset); result == ISC_R_SUCCESS;
|
for (result = dns_rdataset_first(rdataset); result == ISC_R_SUCCESS;
|
||||||
|
|||||||
@@ -54,21 +54,16 @@
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
||||||
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
||||||
dns_ttl_t maxttl, dns_rdataset_t *addedrdataset);
|
dns_ttl_t maxttl, bool optout, bool secure,
|
||||||
isc_result_t
|
dns_rdataset_t *addedrdataset);
|
||||||
dns_ncache_addoptout(dns_message_t *message, dns_db_t *cache,
|
|
||||||
dns_dbnode_t *node, dns_rdatatype_t covers,
|
|
||||||
isc_stdtime_t now, dns_ttl_t minttl, dns_ttl_t maxttl,
|
|
||||||
bool optout, dns_rdataset_t *addedrdataset);
|
|
||||||
/*%<
|
/*%<
|
||||||
* Convert the authority data from 'message' into a negative cache
|
* Convert the authority data from 'message' into a negative cache
|
||||||
* rdataset, and store it in 'cache' at 'node' with a TTL limited to
|
* rdataset, and store it in 'cache' at 'node' with a TTL limited to
|
||||||
* 'maxttl'.
|
* 'maxttl'.
|
||||||
*
|
*
|
||||||
* \li dns_ncache_add produces a negative cache entry with a trust of no
|
* \li if 'secure' is true and all the records that make up the entry
|
||||||
* more than answer
|
* are secure, then dns_ncache_add produces a negative cache entry
|
||||||
* \li dns_ncache_addoptout produces a negative cache entry which will have
|
* with trust level secure.
|
||||||
* a trust of secure if all the records that make up the entry are secure.
|
|
||||||
*
|
*
|
||||||
* The 'covers' argument is the RR type whose nonexistence we are caching,
|
* The 'covers' argument is the RR type whose nonexistence we are caching,
|
||||||
* or dns_rdatatype_any when caching a NXDOMAIN response.
|
* or dns_rdatatype_any when caching a NXDOMAIN response.
|
||||||
|
|||||||
@@ -50,12 +50,6 @@ atomic_getuint8(isc_buffer_t *b) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static isc_result_t
|
|
||||||
addoptout(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
|
||||||
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
|
||||||
dns_ttl_t maxttl, bool optout, bool secure,
|
|
||||||
dns_rdataset_t *addedrdataset);
|
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
copy_rdataset(dns_rdataset_t *rdataset, isc_buffer_t *buffer) {
|
copy_rdataset(dns_rdataset_t *rdataset, isc_buffer_t *buffer) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@@ -107,25 +101,8 @@ copy_rdataset(dns_rdataset_t *rdataset, isc_buffer_t *buffer) {
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
dns_ncache_add(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
||||||
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
||||||
dns_ttl_t maxttl, dns_rdataset_t *addedrdataset) {
|
dns_ttl_t maxttl, bool optout, bool secure,
|
||||||
return addoptout(message, cache, node, covers, now, minttl, maxttl,
|
dns_rdataset_t *addedrdataset) {
|
||||||
false, false, addedrdataset);
|
|
||||||
}
|
|
||||||
|
|
||||||
isc_result_t
|
|
||||||
dns_ncache_addoptout(dns_message_t *message, dns_db_t *cache,
|
|
||||||
dns_dbnode_t *node, dns_rdatatype_t covers,
|
|
||||||
isc_stdtime_t now, dns_ttl_t minttl, dns_ttl_t maxttl,
|
|
||||||
bool optout, dns_rdataset_t *addedrdataset) {
|
|
||||||
return addoptout(message, cache, node, covers, now, minttl, maxttl,
|
|
||||||
optout, true, addedrdataset);
|
|
||||||
}
|
|
||||||
|
|
||||||
static isc_result_t
|
|
||||||
addoptout(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
|
||||||
dns_rdatatype_t covers, isc_stdtime_t now, dns_ttl_t minttl,
|
|
||||||
dns_ttl_t maxttl, bool optout, bool secure,
|
|
||||||
dns_rdataset_t *addedrdataset) {
|
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
isc_buffer_t buffer;
|
isc_buffer_t buffer;
|
||||||
isc_region_t r;
|
isc_region_t r;
|
||||||
|
|||||||
@@ -5263,7 +5263,7 @@ validated(void *arg) {
|
|||||||
* is returned, and that the rdatasets are bound.
|
* is returned, and that the rdatasets are bound.
|
||||||
*/
|
*/
|
||||||
if (val->result == ISC_R_SUCCESS && !negative &&
|
if (val->result == ISC_R_SUCCESS && !negative &&
|
||||||
val->rdataset != NULL && CHAINING(val->rdataset))
|
CHAINING(val->rdataset))
|
||||||
{
|
{
|
||||||
if (val->rdataset->type == dns_rdatatype_cname) {
|
if (val->rdataset->type == dns_rdatatype_cname) {
|
||||||
eresult = DNS_R_CNAME;
|
eresult = DNS_R_CNAME;
|
||||||
@@ -5357,18 +5357,14 @@ validated(void *arg) {
|
|||||||
nextval = ISC_LIST_HEAD(fctx->validators);
|
nextval = ISC_LIST_HEAD(fctx->validators);
|
||||||
if (nextval != NULL) {
|
if (nextval != NULL) {
|
||||||
dns_validator_send(nextval);
|
dns_validator_send(nextval);
|
||||||
goto cleanup_fetchctx;
|
|
||||||
} else if (sentresponse) {
|
} else if (sentresponse) {
|
||||||
done = true;
|
done = true;
|
||||||
goto cleanup_fetchctx;
|
|
||||||
} else if (result == DNS_R_BROKENCHAIN) {
|
} else if (result == DNS_R_BROKENCHAIN) {
|
||||||
done = true;
|
done = true;
|
||||||
goto cleanup_fetchctx;
|
|
||||||
} else {
|
} else {
|
||||||
fctx_try(fctx, true);
|
fctx_try(fctx, true);
|
||||||
goto cleanup_fetchctx;
|
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
goto cleanup_fetchctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (negative) {
|
if (negative) {
|
||||||
@@ -5659,11 +5655,22 @@ answer_response:
|
|||||||
* Negative results must be indicated in val->result.
|
* Negative results must be indicated in val->result.
|
||||||
*/
|
*/
|
||||||
INSIST(hresp->rdataset != NULL);
|
INSIST(hresp->rdataset != NULL);
|
||||||
if (dns_rdataset_isassociated(hresp->rdataset) &&
|
if (dns_rdataset_isassociated(hresp->rdataset)) {
|
||||||
NEGATIVE(hresp->rdataset))
|
if (NEGATIVE(hresp->rdataset)) {
|
||||||
{
|
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
||||||
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
eresult == DNS_R_NCACHENXRRSET);
|
||||||
eresult == DNS_R_NCACHENXRRSET);
|
} else if (eresult == ISC_R_SUCCESS) {
|
||||||
|
switch (hresp->rdataset->type) {
|
||||||
|
case dns_rdatatype_cname:
|
||||||
|
eresult = DNS_R_CNAME;
|
||||||
|
break;
|
||||||
|
case dns_rdatatype_dname:
|
||||||
|
eresult = DNS_R_DNAME;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
hresp->result = eresult;
|
hresp->result = eresult;
|
||||||
@@ -6313,11 +6320,22 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
|
|||||||
* Negative results must be indicated in
|
* Negative results must be indicated in
|
||||||
* resp->result.
|
* resp->result.
|
||||||
*/
|
*/
|
||||||
if (dns_rdataset_isassociated(resp->rdataset) &&
|
if (dns_rdataset_isassociated(resp->rdataset)) {
|
||||||
NEGATIVE(resp->rdataset))
|
if (NEGATIVE(resp->rdataset)) {
|
||||||
{
|
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
||||||
INSIST(eresult == DNS_R_NCACHENXDOMAIN ||
|
eresult == DNS_R_NCACHENXRRSET);
|
||||||
eresult == DNS_R_NCACHENXRRSET);
|
} else if (eresult == ISC_R_SUCCESS) {
|
||||||
|
switch (resp->rdataset->type) {
|
||||||
|
case dns_rdatatype_cname:
|
||||||
|
eresult = DNS_R_CNAME;
|
||||||
|
break;
|
||||||
|
case dns_rdatatype_dname:
|
||||||
|
eresult = DNS_R_DNAME;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
resp->result = eresult;
|
resp->result = eresult;
|
||||||
if (adbp != NULL && *adbp != NULL) {
|
if (adbp != NULL && *adbp != NULL) {
|
||||||
@@ -6382,8 +6400,7 @@ cache_message(fetchctx_t *fctx, dns_message_t *message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do what dns_ncache_addoptout() does, and then compute an appropriate
|
* Call dns_ncache_add() and then compute an appropriate eresult.
|
||||||
* eresult.
|
|
||||||
*/
|
*/
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
||||||
@@ -6397,14 +6414,9 @@ ncache_adderesult(dns_message_t *message, dns_db_t *cache, dns_dbnode_t *node,
|
|||||||
dns_rdataset_init(&rdataset);
|
dns_rdataset_init(&rdataset);
|
||||||
ardataset = &rdataset;
|
ardataset = &rdataset;
|
||||||
}
|
}
|
||||||
if (secure) {
|
|
||||||
result = dns_ncache_addoptout(message, cache, node, covers, now,
|
result = dns_ncache_add(message, cache, node, covers, now, optout,
|
||||||
minttl, maxttl, optout,
|
secure, minttl, maxttl, ardataset);
|
||||||
ardataset);
|
|
||||||
} else {
|
|
||||||
result = dns_ncache_add(message, cache, node, covers, now,
|
|
||||||
minttl, maxttl, ardataset);
|
|
||||||
}
|
|
||||||
if (result == DNS_R_UNCHANGED || result == ISC_R_SUCCESS) {
|
if (result == DNS_R_UNCHANGED || result == ISC_R_SUCCESS) {
|
||||||
/*
|
/*
|
||||||
* If the cache now contains a negative entry and we
|
* If the cache now contains a negative entry and we
|
||||||
|
|||||||
Reference in New Issue
Block a user