Skip to content

Bonjour Conformance Test updates#230

Draft
fhunleth wants to merge 5 commits intomainfrom
conformance
Draft

Bonjour Conformance Test updates#230
fhunleth wants to merge 5 commits intomainfrom
conformance

Conversation

@fhunleth
Copy link
Copy Markdown
Member

@fhunleth fhunleth commented Mar 3, 2026

  • Support ANY query type and case-insensitive domain matching
  • Set cache-flush bit on unique (non-shared) mDNS records
  • Add mDNS probing and announcing state machine
  • Add known-answer suppression module
  • Integrate probing, response timing, and suppression into Responder

fhunleth and others added 5 commits March 2, 2026 17:41
RFC 6762 §6 requires that query type 255 (ANY) matches all record types
and query class 255 (ANY) matches all classes. Also, DNS names must be
compared case-insensitively per the RFC.

Replace the exact match in Table.run_query/2 with wildcard-aware helpers
for type, class, and domain matching. Handle both the :any atom and
integer 255 that Erlang's :inet_dns may produce.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
RFC 6762 §10.2 requires the cache-flush bit to be set on unique records
(A, AAAA, SRV, TXT) in responses, telling receivers to flush stale
cached entries. Shared records (PTR) must not have this bit set.

Set `func: true` in Table.Builder for all non-PTR record types. Update
test expectations to match the new func field values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement RFC 6762 §8 probing and announcing as a pure functional state
machine in MdnsLite.Probe. The module has no side effects -- it returns
action tuples that the caller dispatches.

The state machine transitions through :probing -> :announcing -> 🏃
- Sends 3 probe packets at 250ms intervals with random initial delay
- On success, sends up to 8 announcements with doubling intervals
- Detects conflicts and renames hostname (hostname-2, -3, etc.)
- Rate-limits probing after 15 consecutive conflicts
- Handles simultaneous probe tiebreaking per RFC 6762 §8.2

Also adds Options.conflict_rename/1 helper for hostname renaming.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implement RFC 6762 §7.1 known-answer suppression as a pure function.
When a querier includes known-answer records in a query, the responder
suppresses answers where the known-answer TTL exceeds half of our TTL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rework the Responder GenServer to implement the mDNS protocol behaviors
required by RFC 6762:

Probing and announcing (§8):
- Start probing on interface init, dispatch Probe actions via timers
- Suppress query responses for names being probed
- Detect conflicts from incoming responses and simultaneous probes
- Rename hostname and re-probe on conflict via TableServer

Response handling (§6, §7):
- Strip cache-flush bit on unicast/legacy responses (§6.7)
- Delay shared record (PTR) responses by random 20-125ms (§6)
- Aggregate rapid queries to same destination into single response
- Apply known-answer suppression from query answer sections (§7.1)
- Aggregate answers for multiple questions per query into one response
- Handle TC (truncated) bit by accumulating known-answers across packets

Goodbye packets (§10.1):
- TableServer computes record diffs on option changes and notifies
  Responders of removed records
- Responder multicasts removed records with TTL=0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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