]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: don't store udp/tcp fd in DnsPacket object 16985/head
authorLennart Poettering <lennart@poettering.net>
Tue, 8 Sep 2020 17:41:44 +0000 (19:41 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 8 Sep 2020 17:47:30 +0000 (19:47 +0200)
commit0354029bf572489bf968a39c537ec0cbdef828ce
tree9b1620bf488e5c534cb673d8ab260c36980f97eb
parentae8f0ec323f3cc1b75e2d25d4832fd9bc232261b
resolved: don't store udp/tcp fd in DnsPacket object

DnsPacket should better be a "dead" object, i.e. list facts, not track
resources. By including an fd in its fields it started tracking
resources however, without actually taking a ref to the fd (i.e. no
dup() or so was called on it).

Let's hence rework things so that we don#t have to keep track of the fd
a packet came in from. Instead, pass around the DnsStubListenerExtra
object wherever we need to.

This should be useful as soon as we start caching whole DnsPacket
objects to allow replying to DNSSEC/CO packets, i.e. where we have to
keep a copy of the original DnsPacket around for a long time in cache,
potentially much longer than the fds the packet was received on.
src/resolve/resolved-conf.c
src/resolve/resolved-dns-packet.h
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-stream.h
src/resolve/resolved-dns-stub.c
src/resolve/resolved-dns-stub.h
src/resolve/resolved-manager.c