Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mDNS announcement spam on all interfaces. Fixes #5435 #5455

Closed
wants to merge 1 commit into from

Conversation

t3hk0d3
Copy link

@t3hk0d3 t3hk0d3 commented Nov 26, 2024

Proposed change

Currently there is an issue with mDNS announcement enabled by default on all interfaces.
See #5435 and home-assistant/operating-system#1163

This PR changes code to announce mDNS only on primary interface, and switch other interfaces to "resolve-only" mode.

Only downside of this solution is when Home Assistant is used with fully-separated networks, when multicast traffic doesn't travel between different network through router (for example).
However i believe amount of such installations is miniscule and its unlikely they rely on mDNS.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@t3hk0d3 t3hk0d3 changed the title Draft: Fix mDNS announcement spam on all interfaces. Fixes #5435 Fix mDNS announcement spam on all interfaces. Fixes #5435 Nov 26, 2024
@agners agners added the new-feature A new feature label Nov 26, 2024
@agners
Copy link
Member

agners commented Nov 26, 2024

First off, thanks for your PR 🙏 ! I think this has the potential to resolve a problem folks have in their environment!

But I'd like to have this framed properly:

Currently there is an issue with mDNS announcement enabled by default on all interfaces.

There is no issue, unless you operate in a specific network setup which operates mDNS in a non-standardized mode. See also #5435 (comment).

So from my POV, this is really a feature to make Home Assistant run better in a popular, but still quite quite specific network setup.

Question is a bit how to expose it: The comfortable approach would be to have a single global flag which would implement what you have now (essentially announce_on_primary_only). The flexible approach would be to have the flag available per-interface, so it can be set for each network interface individually (e.g. a single flag for mDNS and LLMNR named announce_hostname?).

Btw, is this problem specific to mDNS or does it also happen with LLMNR? Is there "LLMNR reflection?" 🤔

@t3hk0d3
Copy link
Author

t3hk0d3 commented Nov 26, 2024

There is no issue, unless you operate in a specific network setup which operates mDNS in a non-standardized mode. See also #5435 (comment).

So from my POV, this is really a feature to make Home Assistant run better in a popular, but still quite quite specific network setup.

I think a proper solution there would be an introduction of control flags for mDNS/LLMNR per-interface.

Btw, is this problem specific to mDNS or does it also happen with LLMNR? Is there "LLMNR reflection?" 🤔

I believe this problem can occur with multicast reflection too.

@agners
Copy link
Member

agners commented Nov 26, 2024

I think a proper solution there would be an introduction of control flags for mDNS/LLMNR per-interface.

Works for me 👍

I believe this problem can occur with multicast reflection too.

What is this? This sounds even more scary 🙈

@t3hk0d3
Copy link
Author

t3hk0d3 commented Nov 27, 2024

Works for me 👍

I'll create a new PR with that solution once i got some spare time, because this would be a MUCH bigger change.

@agners
Copy link
Member

agners commented Dec 9, 2024

I'll create a new PR with that solution once i got some spare time, because this would be a MUCH bigger change.

Ok, closing this one then. Feel free to reach out if you need help getting this to the finishing line, I think it would be a valuable feature to have (as opposed to the current add-on solutions floating around, which is rather hacky 🙈 )

@agners agners closed this Dec 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default mDNS settings results in network flooding
2 participants