Christian Glombek 9bb06d5cd6 resolved: only clamp cache TTLs when actually serving stale data
dns_cache_lookup() computes each answer item's expiry ('until', also the
basis of the SD_RESOLVED_CLAMP_TTL TTL patch) as "30s from now" whenever
the caller did not pass SD_RESOLVED_NO_STALE — keyed on the lookup mode,
not on whether the entry being returned is actually stale. That misfires
in both directions:

 * A fresh entry hit by a serve-stale retry (second transaction attempt
   with StaleRetentionSec= set) has its TTL reported as 30s instead of
   its real remaining TTL.

 * A lookup that passes neither SD_RESOLVED_NO_STALE nor
   SD_RESOLVED_CLAMP_TTL — as the mDNS browse path does for clients
   that set no flags — leaves 'current' at 0, so every answer item's
   expiry becomes the constant absolute time 30s after boot,
   permanently in the past. The RFC 6762 section 5.2 cache maintenance
   schedule that resolved-dns-browse-services.c derives from
   item->until then degenerates to its already-expired fallback.

Key the rewrite on the entry's actual staleness instead: an entry whose
TTL has lapsed keeps reporting "30s from now", so clients don't hold on
to stale data for long, and a fresh entry reports its real expiry. For
lookups with SD_RESOLVED_NO_STALE set nothing changes: a stale entry
already makes the whole chain miss, so every item returned in that mode
is fresh.
2026-08-26 18:43:26 +01:00
2026-08-26 10:59:01 +01:00
2026-08-26 10:59:02 +01:00
…
2026-07-08 08:23:04 +02:00
2026-04-18 14:24:47 +01:00
…
…
2025-06-05 14:39:20 +02:00
2026-03-06 08:55:55 +01:00
2025-10-07 13:00:12 +01:00
…
2026-07-28 19:46:34 +09:00
2026-08-24 11:56:27 +02:00

Systemd

System and Service Manager

OBS Packages Status
Semaphore CI 2.0 Build Status
Coverity Scan Status
OSS-Fuzz Status
CIFuzz
CII Best Practices
Fossies codespell report
Translation status
Coverage Status
Packaging status
OpenSSF Scorecard

Details

Most documentation is available on systemd's website.

Assorted, older, general information about systemd can be found in the systemd Wiki.

Information about build requirements is provided in the README file.

Consult our NEWS file for information about what's new in the most recent systemd versions.

Please see the Code Map for information about this repository's layout and content.

Please see the Hacking guide for information on how to hack on systemd and test your modifications.

Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.

When preparing patches for systemd, please follow our Coding Style Guidelines.

If you are looking for support, please contact our mailing list, join our IRC channel #systemd on libera.chat or Matrix channel

Stable branches with backported patches are available in the stable repo.

We have a security bug bounty program sponsored by the Sovereign Tech Fund hosted on YesWeHack

Repositories with distribution packages built from git main are available on OBS, and also repositories with packages built from the latest stable release

S
Description
systemd patched fork
Readme Cite this repository
409 MiB
Languages
C 88.5%
Shell 5.7%
Python 4.6%
Meson 1.1%