You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android 13 drops a service every 2 minutes: known answers with an impossible TTL suppress all answers #537
What happens: a Redmi Note 12 on Android 13 (MdnsDiscoveryManager from the connectivity module) browses _lara._tcp every ~2 s. Each query lists our PTR as a known answer with a TTL of about 390000 s, which grows by about 1 s per second. We send that PTR with TTL 4500, so a correct remaining TTL could never exceed 4500. Under RFC 6762 §7.1 (suppressed_by_answer: known TTL > half of ours) every answer is suppressed, so the phone never receives the 120 s SRV and A records again. When they expire, Android logs:
That happened every 2 minutes in a 6-minute capture (4 times). The service came back only after the phone's next query without known answers, 0.1 s to 40 s later. A responder that ignores known answers (we compared with libmdns) has no drops with the same phone.
To reproduce: register any service with 0.21.6 on the LAN, browse it from an Android 13 device through NsdManager (discoverServices and periodic resolveService), and watch adb shell dumpsys servicediscovery. A capture on the responder shows the PTR known answers with TTL ~390000.
Possible fix: treat a known answer whose TTL is above the record's own TTL as invalid, so it does not suppress:
A correct querier never sends such a TTL, so this can only add answers, never remove one. With it, the same phone held the service for 6 minutes with no TTL expired, and all crate tests pass, including test_known_answer_suppression. I can send this as a PR with a unit test (test_known_answer_with_impossible_ttl_does_not_suppress).
Thanks for opening this issue! It's an interesting case. Your proposed fix makes sense. Please go ahead open a PR.
There is a rare case when a querier had the record cached from an earlier registration that did use a larger custom TTL. But I think it's OK trade-off: there will just be one extra answer (i.e. not suppressing) that is harmless.
Activity
keepsimple1 commentedon Nov 2, 2026
Thanks for opening this issue! It's an interesting case. Your proposed fix makes sense. Please go ahead open a PR.
There is a rare case when a querier had the record cached from an earlier registration that did use a larger custom TTL. But I think it's OK trade-off: there will just be one extra answer (i.e. not suppressing) that is harmless.