Skip to content

fix: legacy unicast mDNS responder for Android .local - #5

Merged
keskad merged 3 commits into
mainfrom
fix/legacy-unicast-responder
Aug 9, 2026
Merged

fix: legacy unicast mDNS responder for Android .local#5
keskad merged 3 commits into
mainfrom
fix/legacy-unicast-responder

Conversation

@keskad

@keskad keskad commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Own legacy unicast / one-shot mDNS responder (RFC 6762 §6.7) that echoes the query transaction ID and uses TTL 10, working around mdns-sd 0.20.3 hardcoding ID=0 on unicast replies (Android getaddrinfo / browser .local resolution).
  • Interface helpers extended with netmasks, IPv6, and ifindexes for same-subnet A selection and multicast joins.
  • All crate tests migrated from src/ #[cfg(test)] modules to tests/ (microinit-style).

Test plan

  • CI green
  • after merge: make image MICRODNS_REF=main, flash
  • phones: http://bigfred.local:8080 in browser
  • app shows bigfred.local:8080 via probeMdnsHostname

Made with Cursor

keskad and others added 3 commits August 9, 2026 19:16
mdns-sd 0.20.3 unicasts legacy replies but hardcodes ID=0, so Android
getaddrinfo rejects them. Add a SO_REUSEPORT legacy unicast responder
(RFC 6762 §6.7) and move crate tests under tests/.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align transaction-ID echoing and tests with one-shot .local lookups
from Android clients.

Co-authored-by: Cursor <cursoragent@cursor.com>
- refresh_memberships only recomputes when AnswerSet changes (was
  calling getifaddrs every loop iteration, ~5x/s)
- simplify run_loop idle-sleep condition (drop dead branch)
- integration test: retry whole bind-spawn-query cycle on different
  ephemeral ports to eliminate the drop-and-race window

Co-authored-by: Cursor <cursoragent@cursor.com>
@keskad
keskad merged commit 2c534c8 into main Aug 9, 2026
@keskad
keskad deleted the fix/legacy-unicast-responder branch August 9, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant