]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/addns: match additional names in a non case insensitive way
authorStefan Metzmacher <metze@samba.org>
Thu, 26 Sep 2024 12:47:26 +0000 (14:47 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 29 Sep 2024 08:09:46 +0000 (08:09 +0000)
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 <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Sep 29 08:09:46 UTC 2024 on atb-devel-224

lib/addns/dnsquery.c

index 7590c9ff508a2c774bf13420487be5acb6e9548c..c997077bb539fc4a748a77d19fc73a227700704c 100644 (file)
@@ -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. */