The resquery_response() function increases the response counter without
checking if the response was successful. Increase the counter only when
the result indicates success.
QTRACE("response");
- if (isc_sockaddr_pf(&query->addrinfo->sockaddr) == PF_INET) {
- inc_stats(fctx->res, dns_resstatscounter_responsev4);
- } else {
- inc_stats(fctx->res, dns_resstatscounter_responsev6);
+ if (eresult == ISC_R_SUCCESS) {
+ if (isc_sockaddr_pf(&query->addrinfo->sockaddr) == PF_INET) {
+ inc_stats(fctx->res, dns_resstatscounter_responsev4);
+ } else {
+ inc_stats(fctx->res, dns_resstatscounter_responsev6);
+ }
}
rctx = isc_mem_get(fctx->mctx, sizeof(*rctx));