MacOS multicast bound socket is unable to receive multicast packets, so MacOS hosts can only facilitate local same-device discovery #29
Labels
bug
Something isn't working
r&d:polykey:core activity 4
End to End Networking behind Consumer NAT Devices
Describe the bug
The sockets on MacOS binded to
::0
and0.0.0.0
are not able to receive incoming multicast packets despite havingaddMembership
called. Despite this, these sockets are still able to receive the multicast packets sent on the same interface withIP_MULTICAST_LOOP
enabled.This behavior is not exhibited with Linux hosts.
The MacOS system
dns-sd
command is able to find registered services from other devices made by our MDNS stack. This means that the only explanation our MDNS stack on a MacOS host not finding the registered service is that the thesocket.addMembership
is silently failing, or we are passing it incorrect parameters on MacOS specifically.If this is not fixed,
js-mdns
on MacOS would only be able to facilitate discovery on the same deviceTo Reproduce
Run
npm run test -- -t 'register'
on a non-MacOS system.Run
npm run test -- -t 'query'
on a MacOS system.The expectation is that an event will be logged on the MacOS system for the service being discovered. A
console.log
can also be put afterhandleSocketMessage
underif (packet.id === this._id) return;
to show that no incoming multicast packets have been received. (must be placed after this statement, so that packets sent by the MacOS host itself are filtered out)Expected behavior
Incoming multicast packets should be correctly received by the the multicast sockets bound by MDNS.
Screenshots
Platform (please complete the following information)
Additional context
Notify maintainers
@amydevs
The text was updated successfully, but these errors were encountered: