This patch introduces a new internal response state about the analysis
of a DNS response received by a server.
It is dedicated to report to above layer that the response is
'truncated'.
DNS_RESP_WRONG_NAME, /* response does not match query name */
DNS_RESP_CNAME_ERROR, /* error when resolving a CNAME in an atomic response */
DNS_RESP_TIMEOUT, /* DNS server has not answered in time */
+ DNS_RESP_TRUNCATED, /* DNS response is truncated */
};
/* return codes after searching an IP in a DNS response buffer, using a family preference */
resolution->requester_error_cb(resolution, DNS_RESP_CNAME_ERROR);
continue;
+ case DNS_RESP_TRUNCATED:
+ nameserver->counters.truncated += 1;
+ resolution->requester_error_cb(resolution, DNS_RESP_TRUNCATED);
+ continue;
}
nameserver->counters.valid += 1;
break;
case DNS_RESP_ANCOUNT_ZERO:
+ case DNS_RESP_TRUNCATED:
case DNS_RESP_ERROR:
if (resolution->query_type == DNS_RTYPE_ANY) {
/* let's change the query type */