You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network.
I have a host with say three network interfaces : eth0, eth1 and eth2 - and I want to listen to advertisements coming only from eth1.
My service listener is based on browser.py example. The api calls look something like this:
class ZeroconfListener:
"""Class for zeroconf to populate"""
def remove_service(self, _zeroconf, service_type, name):
"""Called when zeroconf when a service is nolonger available"""
do stuff
def add_service(self, zeroconf, service_type, name):
"""Called when zeroconf when a service becomes available"""
do stuff
def update_service(self, *_):
"""Called internally by Zeroconf."""
not needed. do nothing
zeroconf = Zeroconf(ip_version=IPVersion.V6Only, interfaces=[addr_of_eth1])
services = ["_device-info._tcp.local."]
ServiceBrowser(zeroconf, services, ZeroconfListener())
while True: # wait forever
time.sleep(60)
The problem is, I only want to listen to advertisements coming from eth1 but this seems to listen to all the interfaces. I can verify this by publishing a _device-info._tcp.local service from a machine connected on eth0 subnet. I suspect that is because I am not using unicast argument when initialising Zeroconf class, and this line puts a listener on all the interfaces:
Not sure if this is a bug or I am using the API wrong. Please advise. This is all IPv6-only network.
I have a host with say three network interfaces :
eth0
,eth1
andeth2
- and I want to listen to advertisements coming only frometh1
.My service listener is based on
browser.py
example. The api calls look something like this:The problem is, I only want to listen to advertisements coming from
eth1
but this seems to listen to all the interfaces. I can verify this by publishing a_device-info._tcp.local
service from a machine connected oneth0
subnet. I suspect that is because I am not usingunicast
argument when initialisingZeroconf
class, and this line puts a listener on all the interfaces:python-zeroconf/src/zeroconf/_utils/net.py
Line 358 in 18b3cd7
TL;DR Question is, how do I restrict zeroconf to a specific interface? Is this a supported use case?
The text was updated successfully, but these errors were encountered: