verbose(VERB_DETAIL, "query response was %sLAME",
dnsseclame?"DNSSEC ":"");
if(qstate->reply) {
+ /* @@@ DEBUG LAME @@@ */
+ if(1) {
+ log_info("LAME mark. %s time %d",
+ dnsseclame?"dnsseclame":"lame",
+ (int)*qstate->env->now);
+ log_addr(0, "addr", &qstate->reply->addr,
+ qstate->reply->addrlen);
+ log_nametypeclass(0, "delegpt", iq->dp->name,
+ iq->qchase.qtype, iq->qchase.qclass);
+ log_dns_msg("from msg", &iq->response->qinfo,
+ iq->response->rep);
+ if(qstate->reply && qstate->reply->c &&
+ qstate->reply->c->buffer)
+ log_hex("hex packet",
+ ldns_buffer_begin(qstate->reply->c->
+ buffer), ldns_buffer_limit(qstate->
+ reply->c->buffer));
+ }
/* 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,
verbose(VERB_DETAIL, "query response REC_LAME: "
"recursive but not authoritative server");
if(qstate->reply) {
+ /* @@@ DEBUG LAME @@@ */
+ if(1) {
+ log_info("REC_LAME mark. rec_lame time %d",
+ (int)*qstate->env->now);
+ log_addr(0, "addr", &qstate->reply->addr,
+ qstate->reply->addrlen);
+ log_nametypeclass(0, "delegpt", iq->dp->name,
+ iq->qchase.qtype, iq->qchase.qclass);
+ log_dns_msg("from msg", &iq->response->qinfo,
+ iq->response->rep);
+ if(qstate->reply && qstate->reply->c &&
+ qstate->reply->c->buffer)
+ log_hex("hex packet",
+ ldns_buffer_begin(qstate->reply->c->
+ buffer), ldns_buffer_limit(qstate->
+ reply->c->buffer));
+ }
/* 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");
/** 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
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;
*rlame = d->rec_lame;
*alame = d->lame_type_A;
*olame = d->lame_other;
+ if(*dlame || *rlame || *alame || *olame) {
+ /* @@@ DEBUG LAME @@@ */
+ log_info("infra_lookup_lame: looked up LAME d%d r%d a%d o%d",
+ *dlame, *rlame, *alame, *olame);
+ log_nametypeclass(0, "search", name, 0, 0);
+ log_nametypeclass(0, "found",
+ ((struct infra_lame_key*)e->key)->zonename, 0, 0);
+ }
+
lock_rw_unlock(&e->lock);
return *dlame || *rlame || *alame || *olame;
}
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;
int dlame, rlame, alame, olame;
if(infra_lookup_lame(data, name, namelen, timenow,
&dlame, &rlame, &alame, &olame)) {
+ /* @@@ DEBUG LAME ***/
+ log_info("lookup_lame merge in set_lame");
/* merge data into new structure */
if(dlame) d->isdnsseclame = 1;
if(rlame) d->rec_lame = 1;
/* check lameness first, if so, ttl on host does not matter anymore */
if(infra_lookup_lame(host, name, namelen, timenow,
&dlm, &rlm, &alm, &olm)) {
+ /* @@@ DEBUG LAME @@@ */
+ log_info("lookup_lame in get_lame_rtt type %d", qtype);
+ log_addr(0, "for addr", addr, addrlen);
+ log_addr(0, "found addr",
+ &((struct infra_host_key*)e->key)->addr,
+ ((struct infra_host_key*)e->key)->addrlen);
+
if(alm && qtype == LDNS_RR_TYPE_A) {
lock_rw_unlock(&e->lock);
*lame = 1;