From: Wouter Wijngaards Date: Wed, 6 Feb 2008 15:08:38 +0000 (+0000) Subject: fallback EDNS on NOTIMPL. X-Git-Tag: release-0.9~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da073cfc3ebf38d02c868ccbbf469a2872b496b3;p=thirdparty%2Funbound.git fallback EDNS on NOTIMPL. git-svn-id: file:///svn/unbound/trunk@928 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index f64c7b54b..cf4e8ad46 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - changed name of ub_val_result_free to ub_val_resolve_free. - removes warning message during library linking, renamed libunbound/unbound.c -> libunbound.c and worker to libworker. + - fallback without EDNS if result is NOTIMPL as well as on FORMERR. 5 February 2008: Wouter - statistics-interval: seconds option added. diff --git a/doc/TODO b/doc/TODO index ef5f0b3d8..c60f8f638 100644 --- a/doc/TODO +++ b/doc/TODO @@ -7,7 +7,6 @@ o detect OS/400 pthreads implementation that allows upgrading to writelock o understand synthesized DNAMEs, so those TTL=0 packets are cached properly. o understand NSEC/NSEC3, aggressive negative caching, so that updates to NSEC/NSEC3 will result in proper negative responses. -o fallback without EDNS if result is NOTIMPL, now only on FORMERR like in java. o scrubber has slow pkt_subdomain and pkt_strict_subdomain functions. o get serverselection algorithm out of local optimum. make subtargets to get rtt info for a couple of targets, like fetch-policy. diff --git a/services/outside_network.c b/services/outside_network.c index dd019d462..50fa846c0 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -1034,9 +1034,10 @@ serviced_tcp_callback(struct comm_point* c, void* arg, int error, if(error==NETEVENT_NOERROR) infra_update_tcp_works(sq->outnet->infra, &sq->addr, sq->addrlen); - if(error==NETEVENT_NOERROR && LDNS_RCODE_WIRE(ldns_buffer_begin( - c->buffer)) == LDNS_RCODE_FORMERR && - sq->status == serviced_query_TCP_EDNS) { + if(error==NETEVENT_NOERROR && sq->status == serviced_query_TCP_EDNS && + (LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) == + LDNS_RCODE_FORMERR || LDNS_RCODE_WIRE(ldns_buffer_begin( + c->buffer)) == LDNS_RCODE_NOTIMPL) ) { if(!infra_edns_update(sq->outnet->infra, &sq->addr, sq->addrlen, -1, time(0))) log_err("Out of memory caching no edns for host"); @@ -1109,8 +1110,9 @@ serviced_udp_callback(struct comm_point* c, void* arg, int error, } } if(error == NETEVENT_NOERROR && sq->status == serviced_query_UDP_EDNS - && LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) - == LDNS_RCODE_FORMERR) { + && (LDNS_RCODE_WIRE(ldns_buffer_begin(c->buffer)) + == LDNS_RCODE_FORMERR || LDNS_RCODE_WIRE( + ldns_buffer_begin(c->buffer)) == LDNS_RCODE_NOTIMPL)) { /* note no EDNS, fallback without EDNS */ if(!infra_edns_update(outnet->infra, &sq->addr, sq->addrlen, -1, (time_t)now.tv_sec)) {