mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-27 16:51:30 +02:00
MINOR: dns: query type change when last record is a CNAME
DNS servers don't return A or AAAA record if the query points to a CNAME not resolving to the right type. We know it because the last record of the response is a CNAME. We can trigger a new query, switching to a new query type, handled by the layer above.
This commit is contained in:
parent
c1ce5f358e
commit
65ce3f5ee4
@ -2964,6 +2964,7 @@ int snr_resolution_error_cb(struct dns_resolution *resolution, int error_code)
|
|||||||
case DNS_RESP_TRUNCATED:
|
case DNS_RESP_TRUNCATED:
|
||||||
case DNS_RESP_ERROR:
|
case DNS_RESP_ERROR:
|
||||||
case DNS_RESP_NO_EXPECTED_RECORD:
|
case DNS_RESP_NO_EXPECTED_RECORD:
|
||||||
|
case DNS_RESP_CNAME_ERROR:
|
||||||
res_preferred_afinet = resolution->opts->family_prio == AF_INET && resolution->query_type == DNS_RTYPE_A;
|
res_preferred_afinet = resolution->opts->family_prio == AF_INET && resolution->query_type == DNS_RTYPE_A;
|
||||||
res_preferred_afinet6 = resolution->opts->family_prio == AF_INET6 && resolution->query_type == DNS_RTYPE_AAAA;
|
res_preferred_afinet6 = resolution->opts->family_prio == AF_INET6 && resolution->query_type == DNS_RTYPE_AAAA;
|
||||||
|
|
||||||
@ -3024,9 +3025,6 @@ int snr_resolution_error_cb(struct dns_resolution *resolution, int error_code)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DNS_RESP_CNAME_ERROR:
|
|
||||||
break;
|
|
||||||
|
|
||||||
case DNS_RESP_TIMEOUT:
|
case DNS_RESP_TIMEOUT:
|
||||||
if (resolution->status != RSLV_STATUS_TIMEOUT) {
|
if (resolution->status != RSLV_STATUS_TIMEOUT) {
|
||||||
resolution->status = RSLV_STATUS_TIMEOUT;
|
resolution->status = RSLV_STATUS_TIMEOUT;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user