mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-08-17 21:25:50 +02:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f241140a5f | ||
|
|
621495e173 | ||
|
|
2ae646d875 |
@@ -1,3 +1,9 @@
|
||||
13 January 2009: Wouter
|
||||
- tag updated with:
|
||||
- removed debug printout in val_nsec.c
|
||||
- fix lame marking
|
||||
- iana portlist updated
|
||||
|
||||
8 January 2009: Wouter
|
||||
- new version of ldns-trunk (today) included as tarball, fixed
|
||||
bug #224, building with -j race condition.
|
||||
|
||||
+38
-2
@@ -840,6 +840,8 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
iq->qchase.qname_len = slen;
|
||||
/* This *is* a query restart, even if it is a cheap
|
||||
* one. */
|
||||
iq->dp = NULL;
|
||||
iq->refetch_glue = 0;
|
||||
iq->query_restart_count++;
|
||||
return next_state(iq, INIT_REQUEST_STATE);
|
||||
}
|
||||
@@ -857,6 +859,7 @@ processInitRequest(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
log_err("alloc failure for forward dp");
|
||||
return error_response(qstate, id, LDNS_RCODE_SERVFAIL);
|
||||
}
|
||||
iq->refetch_glue = 0;
|
||||
/* the request has been forwarded.
|
||||
* forwarded requests need to be immediately sent to the
|
||||
* next state, QUERYTARGETS. */
|
||||
@@ -1351,6 +1354,19 @@ processQueryTargets(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** find NS rrset in given list */
|
||||
static struct ub_packed_rrset_key*
|
||||
find_NS(struct reply_info* rep, size_t from, size_t to)
|
||||
{
|
||||
size_t i;
|
||||
for(i=from; i<to; i++) {
|
||||
if(ntohs(rep->rrsets[i]->rk.type) == LDNS_RR_TYPE_NS)
|
||||
return rep->rrsets[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process the query response. All queries end up at this state first. This
|
||||
* process generally consists of analyzing the response and routing the
|
||||
@@ -1402,6 +1418,20 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
dnsseclame = 1;
|
||||
}
|
||||
}
|
||||
/* see if referral brings us close to the target */
|
||||
if(type == RESPONSE_TYPE_REFERRAL) {
|
||||
struct ub_packed_rrset_key* ns = find_NS(
|
||||
iq->response->rep, iq->response->rep->an_numrrsets,
|
||||
iq->response->rep->an_numrrsets
|
||||
+ iq->response->rep->ns_numrrsets);
|
||||
if(!ns) find_NS(iq->response->rep, 0,
|
||||
iq->response->rep->an_numrrsets);
|
||||
if(!ns || !dname_strict_subdomain_c(ns->rk.dname, iq->dp->name)
|
||||
|| !dname_subdomain_c(iq->qchase.qname, ns->rk.dname)){
|
||||
verbose(VERB_ALGO, "bad referral, throwaway");
|
||||
type = RESPONSE_TYPE_THROWAWAY;
|
||||
}
|
||||
}
|
||||
|
||||
/* handle each of the type cases */
|
||||
if(type == RESPONSE_TYPE_ANSWER) {
|
||||
@@ -1529,7 +1559,10 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
/* Cache the LAMEness. */
|
||||
verbose(VERB_DETAIL, "query response was %sLAME",
|
||||
dnsseclame?"DNSSEC ":"");
|
||||
if(qstate->reply) {
|
||||
if(!dname_subdomain_c(iq->qchase.qname, iq->dp->name)) {
|
||||
log_err("mark lame: mismatch in qname and dpname");
|
||||
/* throwaway this reply below */
|
||||
} else if(qstate->reply) {
|
||||
/* need addr for lameness cache, but we may have
|
||||
* gotten this from cache, so test to be sure */
|
||||
if(!infra_set_lame(qstate->env->infra_cache,
|
||||
@@ -1544,7 +1577,10 @@ processQueryResponse(struct module_qstate* qstate, struct iter_qstate* iq,
|
||||
/* Cache the LAMEness. */
|
||||
verbose(VERB_DETAIL, "query response REC_LAME: "
|
||||
"recursive but not authoritative server");
|
||||
if(qstate->reply) {
|
||||
if(!dname_subdomain_c(iq->qchase.qname, iq->dp->name)) {
|
||||
log_err("mark rec_lame: mismatch in qname and dpname");
|
||||
/* throwaway this reply below */
|
||||
} else if(qstate->reply) {
|
||||
/* need addr for lameness cache, but we may have
|
||||
* gotten this from cache, so test to be sure */
|
||||
verbose(VERB_DETAIL, "mark as REC_LAME");
|
||||
|
||||
Vendored
+4
-4
@@ -268,9 +268,9 @@ infra_host(struct infra_cache* infra, struct sockaddr_storage* addr,
|
||||
|
||||
/** hash lameness key */
|
||||
static hashvalue_t
|
||||
hash_lameness(uint8_t* name, size_t namelen)
|
||||
hash_lameness(uint8_t* name)
|
||||
{
|
||||
return hashlittle(name, namelen, 0xab);
|
||||
return dname_query_hash(name, 0xab);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -283,7 +283,7 @@ infra_lookup_lame(struct infra_host_data* host,
|
||||
struct infra_lame_data *d;
|
||||
if(!host->lameness)
|
||||
return 0;
|
||||
k.entry.hash = hash_lameness(name, namelen);
|
||||
k.entry.hash = hash_lameness(name);
|
||||
k.zonename = name;
|
||||
k.namelen = namelen;
|
||||
k.entry.key = (void*)&k;
|
||||
@@ -375,7 +375,7 @@ infra_set_lame(struct infra_cache* infra,
|
||||
return 0;
|
||||
}
|
||||
lock_rw_init(&k->entry.lock);
|
||||
k->entry.hash = hash_lameness(name, namelen);
|
||||
k->entry.hash = hash_lameness(name);
|
||||
k->entry.key = (void*)k;
|
||||
k->entry.data = (void*)d;
|
||||
d->ttl = timenow + infra->lame_ttl;
|
||||
|
||||
@@ -3986,6 +3986,7 @@
|
||||
4988,
|
||||
4989,
|
||||
4990,
|
||||
4991,
|
||||
4999,
|
||||
5000,
|
||||
5001,
|
||||
|
||||
@@ -543,7 +543,7 @@ int val_nsec_check_dlv(struct query_info* qinfo,
|
||||
continue;
|
||||
if(val_nsec_proves_name_error(rep->rrsets[i],
|
||||
qinfo->qname)) {
|
||||
log_nametypeclass(0, "topdomain on",
|
||||
log_nametypeclass(VERB_ALGO, "topdomain on",
|
||||
rep->rrsets[i]->rk.dname,
|
||||
ntohs(rep->rrsets[i]->rk.type), 0);
|
||||
dlv_topdomain(rep->rrsets[i], qinfo->qname,
|
||||
|
||||
Reference in New Issue
Block a user