]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix prematurely terminated TCP queries when a reply has the same ID.
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 11 Jan 2022 09:00:04 +0000 (10:00 +0100)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 11 Jan 2022 09:00:45 +0000 (10:00 +0100)
doc/Changelog
services/outside_network.c

index 1c88f97246cafebd979df3b8c9ad60c4567b2841..586cd1c372ca0df168eeb016f2f1b797feac038b 100644 (file)
@@ -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.
index f4a5d07078455fec0de6caa1bf441447bf789fa4..d2389dd2d9501a072d8ad407b09c4b3e480b2b98 100644 (file)
@@ -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) {