]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Skip TCP dispatch responses that are not ours
authorOndřej Surý <ondrej@isc.org>
Wed, 2 Oct 2024 06:37:48 +0000 (08:37 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 2 Oct 2024 10:41:04 +0000 (10:41 +0000)
When matching the TCP dispatch responses, we should skip the responses
that do not belong to our TCP connection.  This can happen with faulty
upstream server that sends invalid QID back to us.

lib/dns/dispatch.c

index be6f37868801277e816cf4003b4823ba22e89a2d..f86d73a7b9bec69514609043de16fb0d52bddfcc 100644 (file)
@@ -692,7 +692,9 @@ tcp_recv_success(dns_dispatch_t *disp, isc_region_t *region,
 
        dns_dispentry_t *resp = cds_lfht_entry(cds_lfht_iter_get_node(&iter),
                                               dns_dispentry_t, ht_node);
-       if (resp != NULL) {
+
+       /* Skip responses that are not ours */
+       if (resp != NULL && resp->disp == disp) {
                if (!resp->reading) {
                        /*
                         * We already got a message for this QID and weren't