BUG/MEDIUM: dns: Consider the fact that dns answers are case-insensitive
authorOlivier Houchard <cognet@ci0.org>
Wed, 1 Apr 2020 16:30:27 +0000 (18:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Mar 2021 15:39:31 +0000 (16:39 +0100)
commitb433dd825aa8931d372b9ebc716caeeabaf64b35
treed059490924fb14ccce3515382331728614076f1e
parent734686cbd2e443e94c981c8798f0a25ee6062ef3
BUG/MEDIUM: dns: Consider the fact that dns answers are case-insensitive

We can't expect the DNS answer to always match the case we used for the
request, so we can't just use memcmp() to compare the DNS answer with what
we are expected.
Instead, introduce dns_hostname_cmp(), which compares each string in a
case-insensitive way.
This should fix github issue #566.

This should be backported to 2.1, 2.0, 1.9 and 1.8.

(cherry picked from commit b17b884870e4a934f05f804c08dfaf8d7b54ed35)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/dns.c