mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
- 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:
parent
4cc482e222
commit
75bce22b30
5 changed files with 15 additions and 10 deletions
|
|
@ -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
|
19 May 2010: Wouter
|
||||||
- Fix resolution for domains like safesvc.com.cn. If the iterator
|
- Fix resolution for domains like safesvc.com.cn. If the iterator
|
||||||
can not recurse further and it finds the delegation in a state
|
can not recurse further and it finds the delegation in a state
|
||||||
|
|
|
||||||
7
services/cache/infra.c
vendored
7
services/cache/infra.c
vendored
|
|
@ -514,8 +514,11 @@ infra_edns_update(struct infra_cache* infra,
|
||||||
}
|
}
|
||||||
/* have an entry, update the rtt, and the ttl */
|
/* have an entry, update the rtt, and the ttl */
|
||||||
data = (struct infra_host_data*)e->data;
|
data = (struct infra_host_data*)e->data;
|
||||||
data->edns_version = edns_version;
|
/* do not update if noEDNS and stored is yesEDNS */
|
||||||
data->edns_lame_known = 1;
|
if(!(edns_version == -1 && data->edns_version != -1)) {
|
||||||
|
data->edns_version = edns_version;
|
||||||
|
data->edns_lame_known = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if(needtoinsert)
|
if(needtoinsert)
|
||||||
slabhash_insert(infra->hosts, e->hash, e, e->data, NULL);
|
slabhash_insert(infra->hosts, e->hash, e, e->data, NULL);
|
||||||
|
|
|
||||||
1
services/cache/infra.h
vendored
1
services/cache/infra.h
vendored
|
|
@ -251,6 +251,7 @@ void infra_update_tcp_works(struct infra_cache* infra,
|
||||||
* @param addr: host address.
|
* @param addr: host address.
|
||||||
* @param addrlen: length of addr.
|
* @param addrlen: length of addr.
|
||||||
* @param edns_version: the version that it publishes.
|
* @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.
|
* @param timenow: what time it is now.
|
||||||
* @return: 0 on error.
|
* @return: 0 on error.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1244,8 +1244,7 @@ serviced_udp_send(struct serviced_query* sq, ldns_buffer* buff)
|
||||||
&edns_lame_known, &rtt))
|
&edns_lame_known, &rtt))
|
||||||
return 0;
|
return 0;
|
||||||
if(sq->status == serviced_initial) {
|
if(sq->status == serviced_initial) {
|
||||||
if((vs != -1 || edns_lame_known == 0) &&
|
if(edns_lame_known == 0 && rtt > 5000 && rtt < 10001) {
|
||||||
rtt > 5000 && rtt < 10001) {
|
|
||||||
/* perform EDNS lame probe - check if server is
|
/* perform EDNS lame probe - check if server is
|
||||||
* EDNS lame (EDNS queries to it are dropped) */
|
* EDNS lame (EDNS queries to it are dropped) */
|
||||||
verbose(VERB_ALGO, "serviced query: send probe to see "
|
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) {
|
if(error == NETEVENT_TIMEOUT) {
|
||||||
int rto = 0;
|
int rto = 0;
|
||||||
if(sq->status == serviced_query_PROBE_EDNS) {
|
if(sq->status == serviced_query_PROBE_EDNS) {
|
||||||
/* non-EDNS probe failed; not an EDNS lame server */
|
/* non-EDNS probe failed; we do not know its status,
|
||||||
if(!infra_edns_update(outnet->infra, &sq->addr,
|
* keep trying with EDNS, timeout may not be caused
|
||||||
sq->addrlen, 0, (uint32_t)now.tv_sec)) {
|
* by EDNS. */
|
||||||
log_err("Out of memory caching edns works");
|
|
||||||
}
|
|
||||||
sq->status = serviced_query_UDP_EDNS;
|
sq->status = serviced_query_UDP_EDNS;
|
||||||
}
|
}
|
||||||
sq->retry++;
|
sq->retry++;
|
||||||
|
|
|
||||||
|
|
@ -407,7 +407,7 @@ infra_test()
|
||||||
unit_assert( infra_edns_update(slab, &one, onelen, -1, now) );
|
unit_assert( infra_edns_update(slab, &one, onelen, -1, now) );
|
||||||
unit_assert( infra_host(slab, &one, onelen,
|
unit_assert( infra_host(slab, &one, onelen,
|
||||||
now, &vs, &edns_lame, &to) );
|
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;
|
now += cfg->host_ttl + 10;
|
||||||
unit_assert( infra_host(slab, &one, onelen,
|
unit_assert( infra_host(slab, &one, onelen,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue