Repository navigation
fix: do not suppress answers on a known-answer TTL above our own - #539
Merged
keepsimple1 merged 1 commit intoNov 3, 2026
Merged
Conversation
An Android 13 phone lists our 4500 s PTR as a known answer with a TTL of about 390000 s. Any value above half of our TTL suppressed the answer, so the phone stopped getting the 120 s SRV and A records sent along with it, and dropped the service when they expired, every 2 minutes. A correct querier cannot have more time left than the TTL we send, so treat such a known answer as invalid. A querier that cached the record from an earlier registration with a larger TTL gets one extra answer, which is harmless. Fixes keepsimple1#537
keepsimple1
approved these changes
Nov 3, 2026
keepsimple1
left a comment
Owner
There was a problem hiding this comment.
Changes LGTM, thanks!
nitpick: the PR description is garbled in three places: “ttleep working”, “parse eck the result”, and “Without the change s in the same length of capture”. It looks like text got lost while pasting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #537
suppressed_by_answersuppresses an answer when the known-answer TTL is more than half of ours, with no upper limit. An Android 13 phone lists our 4500 s PTR with a TTL of about 390000 s, so every answer is suppressed. The phone stops getting the 120 s SRV and A records sent along with it, and drops the service when they expire, every 2 minutes.A known answer whose TTL is above the record's own is now treated as invalid and does not suppress.
As you noted on the issue, a querier that cached the record from an earlier registration with a larger custom TTL now gets one extra answer, which is harmless. The doc comment on
suppressed_by_answerrecords this.Tests
test_known_answer_with_impossible_ttl_does_not_suppress: known TTLs of 4501 and 390000 against our 4500 are still answered. It fails without the fix.suppressed.
Both build a real query with
DnsOutgoing, parse eck the result ofadd_answer.cargo testpasses on Windows 11 againstmain(0.21.7): 88 unit, 39 network (mdns_test), 8 shutdown, 3 address-parsing and 4 doc tests.--all-featurespasses too (89 unit). clippy commands andcargo docare clean.Checked on a phone (0.21.6 with this change, before 0.21.7 came out): the Redmi Note 12 from the issue held the service for 6 minutes with no
TTL expired. Without the change s in the same length of capture.