[9.20] fix: usr: Fix assertion failure when receiving DNS responses over TCP

When matching the received Query ID in the TCP connection,
an invalid received Query ID can very rarely cause assertion
failure.

Closes #4952

Backport of MR !9580

Merge branch 'backport-4952-check-whether-QID-is-not-deleted-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9582
This commit is contained in:
Ondřej Surý 2024-10-02 12:07:49 +00:00
commit e2058ab461

View file

@ -694,7 +694,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