1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

resolved: paranoia — ensure DNS reply came over stream we sent it to

This commit is contained in:
Lennart Poettering 2020-11-10 18:45:28 +01:00
parent 8d186a35cb
commit b52eac2010

View File

@ -630,7 +630,8 @@ static int on_stream_packet(DnsStream *s) {
assert_se(p = dns_stream_take_read_packet(s)); assert_se(p = dns_stream_take_read_packet(s));
t = hashmap_get(s->manager->dns_transactions, UINT_TO_PTR(DNS_PACKET_ID(p))); 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); return dns_transaction_on_stream_packet(t, s, p);
/* Ignore incorrect transaction id as an old transaction can have been canceled. */ /* Ignore incorrect transaction id as an old transaction can have been canceled. */