]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/resolve/resolved-dns-query.h
resolved: store just the DnsAnswer instead of a DnsPacket as answer in DnsTransaction...
authorLennart Poettering <lennart@poettering.net>
Thu, 26 Nov 2015 21:51:35 +0000 (22:51 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 26 Nov 2015 23:03:39 +0000 (00:03 +0100)
commitae6a4bbf318e197813227e50c245a00de03784a2
tree94a1761cfa4e445ed820e2cccd01dde7d2949e55
parentb05f5ae7c5a95f44a59e5d2251879d0ef2af9cb2
resolved: store just the DnsAnswer instead of a DnsPacket as answer in DnsTransaction objects

Previously we'd only store the DnsPacket in the DnsTransaction, and the
DnsQuery would then take the DnsPacket's DnsAnswer and return it. With
this change we already pull the DnsAnswer out inside the transaction.

We still store the DnsPacket in the transaction, if we have it, since we
still need to determine from which peer a response originates, to
implement caching properly. However, the DnsQuery logic doesn't care
anymore for the packet, it now only looks at answers and rcodes from the
successfuly candidate.

This also has the benefit of unifying how we propagate incoming packets,
data from the local zone or the local cache.
src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-transaction.c
src/resolve/resolved-dns-transaction.h