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:
Baptiste Assmann 2016-09-05 08:38:57 +02:00 committed by Willy Tarreau
parent c1ce5f358e
commit 65ce3f5ee4

View File

@ -2964,6 +2964,7 @@ int snr_resolution_error_cb(struct dns_resolution *resolution, int error_code)
case DNS_RESP_TRUNCATED:
case DNS_RESP_ERROR:
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_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;
case DNS_RESP_CNAME_ERROR:
break;
case DNS_RESP_TIMEOUT:
if (resolution->status != RSLV_STATUS_TIMEOUT) {
resolution->status = RSLV_STATUS_TIMEOUT;