]> git.ipfire.org Git - thirdparty/systemd.git/commit
dns-rr: invalidate wire format after changing ttl
authordongshengyuan <545258830@qq.com>
Thu, 9 Jul 2026 00:35:03 +0000 (08:35 +0800)
committerdongshengyuan <545258830@qq.com>
Thu, 9 Jul 2026 00:35:03 +0000 (08:35 +0800)
commitccae5c7a4f269bcd7fac39baf93c1cee2c1536a8
treefe1cbc5554c1c82b4538511718431d314cfda622
parent67f72f17653753b1f067a6ed5027b2334b5e7602
dns-rr: invalidate wire format after changing ttl

dns_resource_record_clamp_ttl() may patch the TTL in place when the
record has a single reference. dnssec_fix_rrset_ttl() also updates TTLs
after canonical wire-format data may have been cached.

If a record already has cached wire-format data, that cache still
contains the old TTL and dns_resource_record_to_wire_format() will keep
reusing it.

Add a small helper to clear the cached wire-format state, and use it
whenever the TTL changes. This makes subsequent serialization match the
record fields.

Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
src/resolve/resolved-dns-dnssec.c
src/resolve/test-dns-rr.c
src/shared/dns-rr.c
src/shared/dns-rr.h