From: Baptiste Assmann Date: Mon, 5 Sep 2016 06:38:57 +0000 (+0200) Subject: MINOR: dns: query type change when last record is a CNAME X-Git-Tag: v1.7-dev5~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65ce3f5ee4f010c2fba1126d2315629eacb6568e;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/server.c b/src/server.c index b6eef5db9c..68fa8009f4 100644 --- a/src/server.c +++ b/src/server.c @@ -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;