Skip to content

No service found under Windows but working under Ubuntu VM. #84

@basic-settings

Description

@basic-settings

I am facing some issues in setting up a client/ServiceBrowser that works under both Win and Linux.

I have the following set-up:

  • Win 7 connected to domain
    • Ethernet config uses IPv4 with Subnet Mask 255.255.255.0
  • Ubuntu VM running on the same system in Oracle VirtualBox with Win Ethernet as Bridged Adapter
    enp0s3 Link encap:Ethernet HWaddr 08:00:27:55:62:63 inet addr:10.121.44.95 Bcast:10.121.44.255 Mask:255.255.255.0 inet6 addr: fe80::aa6b:92c:17c4:cfc8/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1837029 errors:0 dropped:0 overruns:0 frame:0 TX packets:110395 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:467243091 (467.2 MB) TX bytes:7871423 (7.8 MB)
  • The broadcasting systems are running on different Debian systems connected to the network domain

If I run the ServiceBrowser from Windows I don't get any return back. I used the example Browser to test the set-up.
`from zeroconf import ServiceBrowser, Zeroconf

class MyListener(object):

def remove_service(self, zeroconf, type, name):
    print("Service %s removed" % (name,))

def add_service(self, zeroconf, type, name):
    info = zeroconf.get_service_info(type, name)
    print("Service %s added, service info: %s" % (name, info))

zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_tntsrv._tcp.local.", listener)
try:
input("Press enter to exit...\n\n")
finally:
zeroconf.close()`
Running from withing Ubuntu, it returns all the available services (as expected).

I noticed that if I change HOST_ONLY_NETWORK_MASK from 255.255.255.255 to 255.255.255.0 the opposite happens, where it works under Windows but not under Ubuntu.

This seems to ocurr in line 1603
if addr.get('netmask') != HOST_ONLY_NETWORK_MASK

I'm not experienced enough to find a common ground, but is there any posibility so that it'll work under both systems?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions