From: George Thessalonikefs Date: Tue, 11 Jan 2022 09:00:04 +0000 (+0100) Subject: - Fix prematurely terminated TCP queries when a reply has the same ID. X-Git-Tag: release-1.15.0rc1~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a97604737b4c25b8b72b0bbf9b6ea16f98bfec15;p=thirdparty%2Funbound.git - Fix prematurely terminated TCP queries when a reply has the same ID. --- diff --git a/doc/Changelog b/doc/Changelog index 1c88f9724..586cd1c37 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +11 January 2022: George + - Fix prematurely terminated TCP queries when a reply has the same ID. + 7 January 2022: Wouter - Merge #600 from pemensik: Change file mode before changing file owner. diff --git a/services/outside_network.c b/services/outside_network.c index f4a5d0707..d2389dd2d 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -1248,6 +1248,12 @@ outnet_tcp_cb(struct comm_point* c, void* arg, int error, c->buffer)); /* find the query the reply is for */ w = reuse_tcp_by_id_find(&pend->reuse, id); + /* Make sure that the reply we got is at least for a + * sent query with the same ID; the waiting_tcp that + * gets a reply is assumed to not be waiting to be + * sent. */ + if(w && (w->on_tcp_waiting_list || w->write_wait_queued)) + w = NULL; } } if(error == NETEVENT_NOERROR && !w) {