frawau / aiozeroconf

An asyncio/pure python implementation of multicast DNS service discovery
GNU Lesser General Public License v2.1
24 stars 6 forks source link

Use specific interface index for calculating mreq if available #2

Closed joshbuddy closed 6 years ago

joshbuddy commented 6 years ago

Hey, in using this library on osx, I discovered it needs a specific interface index if it has one, otherwise you get this error.

s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq)
OSError: [Errno 49] Can't assign requested address

I don't think it should change the behavior on other platforms. Let me know what you think!

frawau commented 6 years ago

Thanks for the PR. The change looks indeed innocuous.