Compare query with case-insensitive compare

Required by TCP queries retrying query on REDHAT.COM VPN, which offers
too many SRV records to fit into reply without EDNS0. That means length
of answer >512 bytes, as used by kinit implementation.
This commit is contained in:
Petr Menšík 2021-10-27 17:22:13 +02:00
parent 19d9817a3e
commit 6ad2d1af9f
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,33 @@
From 6ad1f6f44e77619eeb1f9f16e205c24a1dc3e68b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Thu, 14 Oct 2021 20:56:17 +0200
Subject: [PATCH] Compare order case insensitive
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
DNS labels are defined case insensitive. When queried over TCP, query
name is not put to lower case. Make it match even when domain differs
only by used case.
Signed-off-by: Petr Menšík <pemensik@redhat.com>
---
src/domain-match.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/domain-match.c b/src/domain-match.c
index e5b409e..3a69aa1 100644
--- a/src/domain-match.c
+++ b/src/domain-match.c
@@ -495,7 +495,7 @@ static int order(char *qdomain, size_t qlen, struct server *serv)
if (qlen > dlen)
return -1;
- return strcmp(qdomain, serv->domain);
+ return strcasecmp(qdomain, serv->domain);
}
static int order_servers(struct server *s1, struct server *s2)
--
2.31.1

View File

@ -62,6 +62,8 @@ Patch25: dnsmasq-2.86-domain-match-local.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2009975
# replaces/enhances http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=d290630d31f4517ab26392d00753d1397f9a4114
Patch26: dnsmasq-2.86-build_server_array.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2014019
Patch28: dnsmasq-2.87-tcp-strcasecmp.patch
@ -207,6 +209,7 @@ install -Dpm 644 %{SOURCE2} %{buildroot}%{_sysusersdir}/%{name}.conf
%changelog
* Thu Oct 14 2021 Petr Menšík <pemensik@redhat.com> - 2.86-3
- Rebuild server_array on any server change (#2009975)
- Compare case-insensitive also TCP queries (#2014019)
* Thu Sep 23 2021 Petr Menšík <pemensik@redhat.com> - 2.86-2
- Attempt to fix regression found on recent release (#2006367)