From b52eac2010ab652678e92ae93956db87f4f844e0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 10 Nov 2020 18:45:28 +0100 Subject: [PATCH] =?UTF-8?q?resolved:=20paranoia=20=E2=80=94=20ensure=20DNS?= =?UTF-8?q?=20reply=20came=20over=20stream=20we=20sent=20it=20to?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resolve/resolved-dns-transaction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resolve/resolved-dns-transaction.c b/src/resolve/resolved-dns-transaction.c index 36e38f6532..bd2ae5e4fb 100644 --- a/src/resolve/resolved-dns-transaction.c +++ b/src/resolve/resolved-dns-transaction.c @@ -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. */