Skip to content

According to http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html: "If the h... - #9

Closed
znek wants to merge 2 commits into
python-zeroconf:masterfrom
znek:master
Closed

According to http://www.tldp.org/HOWTO/Multicast-HOWTO-6.html: "If the h...#9
znek wants to merge 2 commits into
python-zeroconf:masterfrom
znek:master

Conversation

@znek

@znek znek commented Oct 28, 2014

Copy link
Copy Markdown

These changes are required as a prerequisite on my FreeBSD box. I'v tested this on OS X as well (see comments). I don't expect these changes to break anything.

However, my original observation still stands: the Zeroconf class needs to iterate on all existing interfaces in order to work properly. The trick with the UDP connect catches just a single interface, which in my (special) case is the wrong (external) interface.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) when pulling 8c51e29 on znek:master into 47ff62b on jstasiak:master.

@jstasiak

Copy link
Copy Markdown
Collaborator

Hey, could you list your OS X and FreeBSD machines interfaces? I'll do some testing when I have a test system with multiple interfaces

@znek

znek commented Oct 31, 2014

Copy link
Copy Markdown
Author

The OS X 10.9.5 desktop:

znek@optimist:(~)$ ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=3<RXCSUM,TXCSUM>
inet6 ::1 prefixlen 128
inet 127.0.0.1 netmask 0xff000000
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=1
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
ether 78:31:XX:XX:XX:XX
media: autoselect ()
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr 00:0a:27:02:XX:XX:XX:XX
nd6 options=1
media: autoselect
status: inactive
en1: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
options=60<TSO4,TSO6>
ether 72:00:XX:XX:XX:XX
media: autoselect
status: inactive
en2: flags=8822<BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
options=60<TSO4,TSO6>
ether 72:00:XX:XX:XX:XX
media: autoselect
status: inactive
en3: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
ether 68:5b:XX:XX:XX:XX
inet6 fe80::XXXX:XXXX:XXXX:XXXX%en3 prefixlen 64 scopeid 0x8
inet 192.168.7.25 netmask 0xffffff00 broadcast 192.168.7.255
nd6 options=1
media: autoselect (1000baseT <full-duplex,flow-control>)
status: active
p2p0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 2304
ether 0a:31:XX:XX:XX:XX
media: autoselect
status: inactive

The FreeBSD 10.1-STABLE server:

znek@creutzfeld:(~)$ ifconfig -a
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
ether 10:fe:XX:XX:XX:XX
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
status: running
igb0: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=403bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,TSO4,TSO6,VLAN_HWTSO>
ether d0:50:XX:XX:XX:XX
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect
status: no carrier
en1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=400b8<VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,VLAN_HWTSO>
ether d0:50:XX:XX:XX:XX
inet6 fe80::XXXX:XXXX:XXXX:XXXX%en1 prefixlen 64 scopeid 0x3
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT )
status: active
pflog0: flags=0<> metric 0 mtu 33160
pfsync0: flags=0<> metric 0 mtu 1500
syncpeer: 0.0.0.0 maxupd: 128 defer: off
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6
inet 192.168.7.2 netmask 0xffffff00
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 02:f9:XX:XX:XX:XX
inet 192.168.7.1 netmask 0xffffff00 broadcast 192.168.7.255
nd6 options=1
id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
member: wlan0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 8 priority 128 path cost 22222
member: en1 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
ifmaxaddr 0 port 3 priority 128 path cost 55
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 10:fe:XX:XX:XX:XX
inet6 fe80::XXXX:XXXX:XXXX:XXXX%wlan0 prefixlen 64 scopeid 0x8
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng
status: running
ssid XXXXXXXXX channel 3 (2422 MHz 11g ht/40+) bssid 10:fe:XX:XX:XX:XX
regdomain ETSI country DE indoor ecm authmode WPA2/802.11i
privacy MIXED deftxkey 2 AES-CCM 2:128-bit AES-CCM 3:128-bit
txpower 30 scanvalid 60 protmode CTS ampdulimit 64k ampdudensity 8
shortgi wme burst dtimperiod 1 -dfs
en0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80000
ether 00:00:XX:XX:XX:XX
inet6 fe80::XXXX:XXXX:XXXX:XXXX%en0 prefixlen 64 scopeid 0x9
inet xxx.xxx.xxx.xxx netmask 0xfffffc00 broadcast 255.255.255.255
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet 100baseTX
status: active

@jstasiak

jstasiak commented Dec 6, 2014

Copy link
Copy Markdown
Collaborator

@znek This's not forgotten - I had some other stuff to deal with but I think I'll merge this change with some configurability added soon (there are some differences between Windows, Linux and OS X/BSD as far as setsockopt is concerned and I'd like it to be as platform independent as possible).

@jstasiak

Copy link
Copy Markdown
Collaborator

@znek Can you test 442a599 (multiple-interfaces branch)? You'll need to specify interfaces when instantiating Zeroconf.

@jstasiak

Copy link
Copy Markdown
Collaborator

FYI it's in master now.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.13%) when pulling 4c2a479 on znek:master into 500a76b on jstasiak:master.

@znek

znek commented Jan 6, 2015

Copy link
Copy Markdown
Author

FreeBSD didn't work out of the box, unfortunately. I've just pushed f84720e which solves an "Address already in use" conflict on a single interface from the list of all interfaces. Curiously, no interface has that IP address in the list assigned and I'm left to only guessing that this somehow has to do with the bridge configuration, but really I don't have a clue.

@znek

znek commented Jan 6, 2015

Copy link
Copy Markdown
Author

I've also pushed 4c2a479 which iterates on all interfaces instead of just the default interface, because that's necessary on my server to conduct the builtin tests. Is there any specific good reason, why the Zeroconf class shouldn't iterate on all interfaces by default? Zeroconf is all about adhoc networkability, thus I don't see any real need to restrict it to just the default interface. This should remain optional, but not as a default IMO.

@jstasiak

jstasiak commented Feb 3, 2015

Copy link
Copy Markdown
Collaborator

@znek Sorry for the long delay, I'll sort out the issues you mentioned. There's no particular reason I set it to default interface only, I just kept the previous behaviour by default but after consideration I think I'll make it use all interfaces and release version with the changes soon.

@jstasiak

jstasiak commented Feb 3, 2015

Copy link
Copy Markdown
Collaborator

@znek Can you test 193cf47 (master)? I didn't pull your code as I didn't want to ignore silently all possible exceptions, just address in use one.

@znek

znek commented Feb 18, 2015

Copy link
Copy Markdown
Author

Just tested 44fa62a, appears to work fine.

@jstasiak

Copy link
Copy Markdown
Collaborator

Thank you, I'll close this one then.

@jstasiak jstasiak closed this Feb 18, 2015
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.

3 participants