From: Wouter Wijngaards Date: Fri, 17 Aug 2018 13:29:27 +0000 (+0000) Subject: - print servfail info to log as error. X-Git-Tag: release-1.8.0rc1~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8385c462edf8effdb9208dd43ed7c079aae952de;p=thirdparty%2Funbound.git - print servfail info to log as error. git-svn-id: file:///svn/unbound/trunk@4859 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 6234bc512..f902b375c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,7 @@ - Set libunbound to increase current, because the libunbound change to the event callback function signature. That needs programs, that use it, to recompile against the new header definition. + - print servfail info to log as error. 16 August 2018: Wouter - Fix warning on compile without threads. diff --git a/iterator/iterator.c b/iterator/iterator.c index cb20c1e7c..db7cdf539 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -1853,6 +1853,7 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq, iq->qchase.qclass, NULL)) { /* fail -- no more targets, no more hope of targets, no hope * of a response. */ + errinf(qstate, "all the configured stub or forward servers failed"); verbose(VERB_QUERY, "configured stub or forward servers failed -- returning SERVFAIL"); return error_response_cache(qstate, id, LDNS_RCODE_SERVFAIL); } @@ -1989,6 +1990,8 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq, iq->deleg_msg?iq->deleg_msg->rep: (iq->response?iq->response->rep:NULL)); + errinf(qstate, "all servers for this domain failed"); + errinf_dname(qstate, ", at zonecut", iq->dp->name); verbose(VERB_QUERY, "out of query targets -- returning SERVFAIL"); /* fail -- no more targets, no more hope of targets, no hope * of a response. */ diff --git a/services/mesh.c b/services/mesh.c index 55b909ede..38f9d99f8 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1155,6 +1155,21 @@ void mesh_query_done(struct mesh_state* mstate) struct mesh_cb* c; struct reply_info* rep = (mstate->s.return_msg? mstate->s.return_msg->rep:NULL); + if(mstate->s.return_rcode == LDNS_RCODE_SERVFAIL || + (rep && FLAGS_GET_RCODE(rep->flags) == LDNS_RCODE_SERVFAIL)) { + char* err = errinf_to_str(&mstate->s); + if(err) { + char nm[255+1]; + char* tp = sldns_wire2str_type(mstate->s.qinfo.qtype); + char* cl = sldns_wire2str_class(mstate->s.qinfo.qclass); + dname_str(mstate->s.qinfo.qname, nm); + log_err("query %s %s %s SERVFAIL with reason: %s", + nm, tp?tp:"t", cl?cl:"c", err); + free(err); + free(tp); + free(cl); + } + } for(r = mstate->reply_list; r; r = r->next) { /* if a response-ip address block has been stored the * information should be logged for each client. */