Skip to content

fix(mdns): only advertise listening addresses matching the interface IP#6500

Open
MatthiasvB wants to merge 1 commit into
libp2p:masterfrom
MatthiasvB:fix/mdns-report-only-relevant-addresses
Open

fix(mdns): only advertise listening addresses matching the interface IP#6500
MatthiasvB wants to merge 1 commit into
libp2p:masterfrom
MatthiasvB:fix/mdns-report-only-relevant-addresses

Conversation

@MatthiasvB

@MatthiasvB MatthiasvB commented Jun 23, 2026

Copy link
Copy Markdown

When responding to mDNS queries, only advertise listening addresses whose IP matches the address family / interface the query arrived on, instead of advertising every listening address. Avoids announcing unreachable addresses.

Description

mDNS currently wildly reports all interface's addresses on all interfaces, which leads to mutiple issues:

Fixes #5995.
Fixes #5790.

There already is a PR, but it's been open for a long time and seems more complex: #6003

AI Assistance Disclosure

Tools used

Github Copilot (initially), rework using Claude Code (Opus 4.8)

Attestation (required):

  • I have read every line of this diff, understand what it does, and can explain it in review.

Notes & open questions

The fix seems smart and in the right place, but I lack complete overview over the crate, so some expert review should verify this is a good spot for the fix

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (not applicable)
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

When responding to mDNS queries, only advertise listening addresses whose IP
matches the address family / interface the query arrived on, instead of
advertising every listening address. Avoids announcing unreachable addresses.
@MatthiasvB MatthiasvB force-pushed the fix/mdns-report-only-relevant-addresses branch from a5db29d to 76d035c Compare June 23, 2026 14:35
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.

Loopback addresses published by mDNS lead to dial failures mDNS: packets are excessively large

1 participant