-
Notifications
You must be signed in to change notification settings - Fork 229
Add ability to specify multicast groups with addresses #1520
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
Comments
Check the example in the Home Assistant zeroconf integration on how to specify |
@bdraco this specifies the interfaces the zeroconf tries to bind to. For the use case that I have I need to add two interfaces to the multicast group while only binding to one of the two. |
While I'm still not 100% sure what you are asking for,
The code to normalize the choices is at python-zeroconf/src/zeroconf/_utils/net.py Line 137 in dba44e4
If you need something more complex we could accept a PR to expand the options. |
Apologies about the lack of information, I opened this issue while being on mobile. I will provide more details tomorrow when I have more time :) I think the best way to articulate the issue is as follows: On iOS, multicast messages sent to and from the device may not be received unless the device explicitly joins a multicast group on both its local IP and 127.0.0.1. Currently(assume interfaces=[localhost, local_ip]), Zeroconf attempts to bind to port 5353 on both those interfaces which will fail because of iOS sandboxing. Ideally zeroconf's implementation should support the following:
I will likely create the PR for this tomorrow assuming I have time. Are there any contribution guidelines for this project? |
Thanks for the additional details. That makes a lot more sense now. It would be helpful if you could also post the log of the exceptions/errors that happen for additional context.
Commit messages should follow https://www.conventionalcommits.org/en/v1.0.0/ to keep the CI happy, however as long as the title of the PR does it will get squashed in the end anyways. |
Also keep in mind we eventually need to implement run time reloads to solve home-assistant/core#59553 so any changes should think about that a bit |
Is zeroconf technically a home-assistant project or are they just tightly intertwined? Just so I know what to look out for |
I will provide some logs later today, it isn't obvious to be honest that something is wrong. When you bind to all addresses it configures a correct multicast group but wont actually broadcast because of using two unique interfaces(seems to be a posix issue but honestly not sure. I think the kernel doesn't know which interface to use for multicast and decides on neither) while actively using those two interfaces. When you bind to just |
zeroconf is not a Home Assistant project. It is the largest known user base for this project though and the source of most issue reports. ie. this project's largest customer. |
Zeroconf assumes that all of the interfaces passed into the library via
Zeroconf(interfaces=[<address_0>, <address_1>,...]
are able to be bound to. This isn't always the case, for example in a sandboxed environment such as iOS.In iOS, you are able to bind a socket to
127.0.0.1:5353
but you aren't able to bind to the en0 and pdp_ip0 interfaces on port 5353 because the system daemon is already bound to that. There needs to be a way to configure which addresses are apart of the multicast group that zeroconf builds in.The text was updated successfully, but these errors were encountered: