]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/resolve/resolved-dns-rr.c
resolved: when using the ResolveRecord() bus call, adjust TTL for caching time
authorLennart Poettering <lennart@poettering.net>
Mon, 20 Jun 2016 19:24:46 +0000 (21:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Jun 2016 11:20:48 +0000 (13:20 +0200)
commit17c8de633faad3ac97012e066c6c6b2f71b83a67
treef27b57fe2aa8de9abad50ce5307ef3ca86b363bb
parent6ebd1e33e6ab3dd56e1aa34f4f0e17a752fb1233
resolved: when using the ResolveRecord() bus call, adjust TTL for caching time

When we return the full RR wire data, let's make sure the TTL included in it is
adjusted by the time the RR sat in the cache.

As an optimization we do this only for ResolveRecord() and not for
ResolveHostname() and friends, since adjusting the TTL means copying the RR
object, and we don#t want to do that if there's no reason to.
(ResolveHostname() and friends don't return the TTL hence there's no reason to
in that case)
12 files changed:
src/basic/bitmap.c
src/basic/bitmap.h
src/resolve/resolved-bus.c
src/resolve/resolved-dns-cache.c
src/resolve/resolved-dns-cache.h
src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-rr.c
src/resolve/resolved-dns-rr.h
src/resolve/resolved-dns-transaction.c
src/resolve/resolved-dns-transaction.h
src/resolve/test-dns-packet.c