mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 07:54:33 +00:00
MINOR: dns: New DNS response analysis code: DNS_RESP_TRUNCATED
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'.
This commit is contained in:
parent
6cdea9359b
commit
0df5d9669a
@ -198,6 +198,7 @@ enum {
|
|||||||
DNS_RESP_WRONG_NAME, /* response does not match query name */
|
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_CNAME_ERROR, /* error when resolving a CNAME in an atomic response */
|
||||||
DNS_RESP_TIMEOUT, /* DNS server has not answered in time */
|
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 */
|
/* return codes after searching an IP in a DNS response buffer, using a family preference */
|
||||||
|
@ -218,6 +218,10 @@ void dns_resolve_recv(struct dgram_conn *dgram)
|
|||||||
resolution->requester_error_cb(resolution, DNS_RESP_CNAME_ERROR);
|
resolution->requester_error_cb(resolution, DNS_RESP_CNAME_ERROR);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case DNS_RESP_TRUNCATED:
|
||||||
|
nameserver->counters.truncated += 1;
|
||||||
|
resolution->requester_error_cb(resolution, DNS_RESP_TRUNCATED);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
nameserver->counters.valid += 1;
|
nameserver->counters.valid += 1;
|
||||||
|
@ -2132,6 +2132,7 @@ int snr_resolution_error_cb(struct dns_resolution *resolution, int error_code)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DNS_RESP_ANCOUNT_ZERO:
|
case DNS_RESP_ANCOUNT_ZERO:
|
||||||
|
case DNS_RESP_TRUNCATED:
|
||||||
case DNS_RESP_ERROR:
|
case DNS_RESP_ERROR:
|
||||||
if (resolution->query_type == DNS_RTYPE_ANY) {
|
if (resolution->query_type == DNS_RTYPE_ANY) {
|
||||||
/* let's change the query type */
|
/* let's change the query type */
|
||||||
|
Loading…
Reference in New Issue
Block a user