- EDNS timeout code will not fire if EDNS status already known.

- EDNS failure not stored if EDNS status known to work.


git-svn-id: file:///svn/unbound/trunk@2115 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2010-05-21 11:00:35 +00:00
parent 4cc482e222
commit 75bce22b30
5 changed files with 15 additions and 10 deletions

View file

@ -1,3 +1,7 @@
21 May 2010: Wouter
- EDNS timeout code will not fire if EDNS status already known.
- EDNS failure not stored if EDNS status known to work.
19 May 2010: Wouter
- Fix resolution for domains like safesvc.com.cn. If the iterator
can not recurse further and it finds the delegation in a state

View file

@ -514,8 +514,11 @@ infra_edns_update(struct infra_cache* infra,
}
/* have an entry, update the rtt, and the ttl */
data = (struct infra_host_data*)e->data;
data->edns_version = edns_version;
data->edns_lame_known = 1;
/* do not update if noEDNS and stored is yesEDNS */
if(!(edns_version == -1 && data->edns_version != -1)) {
data->edns_version = edns_version;
data->edns_lame_known = 1;
}
if(needtoinsert)
slabhash_insert(infra->hosts, e->hash, e, e->data, NULL);

View file

@ -251,6 +251,7 @@ void infra_update_tcp_works(struct infra_cache* infra,
* @param addr: host address.
* @param addrlen: length of addr.
* @param edns_version: the version that it publishes.
* If it is known to support EDNS then no-EDNS is not stored over it.
* @param timenow: what time it is now.
* @return: 0 on error.
*/

View file

@ -1244,8 +1244,7 @@ serviced_udp_send(struct serviced_query* sq, ldns_buffer* buff)
&edns_lame_known, &rtt))
return 0;
if(sq->status == serviced_initial) {
if((vs != -1 || edns_lame_known == 0) &&
rtt > 5000 && rtt < 10001) {
if(edns_lame_known == 0 && rtt > 5000 && rtt < 10001) {
/* perform EDNS lame probe - check if server is
* EDNS lame (EDNS queries to it are dropped) */
verbose(VERB_ALGO, "serviced query: send probe to see "
@ -1494,11 +1493,9 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error,
if(error == NETEVENT_TIMEOUT) {
int rto = 0;
if(sq->status == serviced_query_PROBE_EDNS) {
/* non-EDNS probe failed; not an EDNS lame server */
if(!infra_edns_update(outnet->infra, &sq->addr,
sq->addrlen, 0, (uint32_t)now.tv_sec)) {
log_err("Out of memory caching edns works");
}
/* non-EDNS probe failed; we do not know its status,
* keep trying with EDNS, timeout may not be caused
* by EDNS. */
sq->status = serviced_query_UDP_EDNS;
}
sq->retry++;

View file

@ -407,7 +407,7 @@ infra_test()
unit_assert( infra_edns_update(slab, &one, onelen, -1, now) );
unit_assert( infra_host(slab, &one, onelen,
now, &vs, &edns_lame, &to) );
unit_assert( vs == -1 && to == init*2 && edns_lame == 1);
unit_assert( vs == 0 && to == init*2 && edns_lame == 0);
now += cfg->host_ttl + 10;
unit_assert( infra_host(slab, &one, onelen,