From: Stefan Metzmacher Date: Thu, 26 Sep 2024 12:47:26 +0000 (+0200) Subject: lib/addns: match additional names in a non case insensitive way X-Git-Tag: tdb-1.4.13~1038 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7d255e5c233237041228544b19114bd1f93c2468;p=thirdparty%2Fsamba.git lib/addns: match additional names in a non case insensitive way Sometime proxy dns servers mess up the case of parts of the name... So we should match with strequal() instead of strcmp(), which results in much less dns packets on the wire... Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224 --- diff --git a/lib/addns/dnsquery.c b/lib/addns/dnsquery.c index 7590c9ff508..c997077bb53 100644 --- a/lib/addns/dnsquery.c +++ b/lib/addns/dnsquery.c @@ -151,7 +151,11 @@ static void ads_dns_lookup_srv_done(struct tevent_req *subreq) struct dns_rr_srv *srv = &state->srvs[j]; struct sockaddr_storage *tmp; - if (strcmp(srv->hostname, ar->name) != 0) { + /* + * sometimes the name gets messed up + * with upper and lower case... + */ + if (!strequal(srv->hostname, ar->name)) { continue; } /* uint16_t can't wrap here. */