]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved: paranoia — ensure DNS reply came over stream we sent it to
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Nov 2020 17:45:28 +0000 (18:45 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 16 Feb 2021 16:43:27 +0000 (17:43 +0100)
src/resolve/resolved-dns-transaction.c

index 36e38f6532226e5b16a45c6e9df3ab5167f5aa56..bd2ae5e4fb7bef8de0938c1204b54099af771d80 100644 (file)
@@ -630,7 +630,8 @@ static int on_stream_packet(DnsStream *s) {
         assert_se(p = dns_stream_take_read_packet(s));
 
         t = hashmap_get(s->manager->dns_transactions, UINT_TO_PTR(DNS_PACKET_ID(p)));
-        if (t)
+        if (t && t->stream == s) /* Validate that the stream we got this on actually is the stream the
+                                  * transaction was using. */
                 return dns_transaction_on_stream_packet(t, s, p);
 
         /* Ignore incorrect transaction id as an old transaction can have been canceled. */