From: Christopher Faulet Date: Thu, 2 Dec 2021 09:05:02 +0000 (+0100) Subject: BUG/MINOR: resolvers: Don't overwrite the error for invalid query domain name X-Git-Tag: v2.6-dev1~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af93d2fd70ef03d89d11b0d6b04e4f60a8ff002f;p=thirdparty%2Fhaproxy.git BUG/MINOR: resolvers: Don't overwrite the error for invalid query domain name When a response is validated, the query domain name is checked to be sure it is the same than the one requested. When an error is reported, the wrong goto label was used. Thus, the error was lost. Instead of RSLV_RESP_WRONG_NAME, RSLV_RESP_INVALID was reported. This bug was introduced by the commit c1699f8c1 ("MEDIUM: resolvers: No longer store query items in a list into the response"). This patch should fix the issue #1473. No backport is needed. --- diff --git a/src/resolvers.c b/src/resolvers.c index 3090cb4a00..ec187aa307 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -1004,7 +1004,7 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe if (len != resolution->hostname_dn_len || memcmp(query->name, resolution->hostname_dn, resolution->hostname_dn_len) != 0) { cause = RSLV_RESP_WRONG_NAME; - goto invalid_resp; + goto return_error; } reader += offset;