mdns icon indicating copy to clipboard operation
mdns copied to clipboard

Explicitly set IP_MULTICAST_IF to ensure that queries are sent on specified NIC

Open jaime-sense opened this issue 4 years ago • 3 comments

When using a multihomed environment, the library allows the user to specified a NIC to search for a particular service; however without setting IP_MULTICAST_IF, the OS is free to send the query on an interface of its choosing. This change forces the send to occur on the user specified interface. This change works also when using INADDR_ANY.

jaime-sense avatar Oct 30 '21 23:10 jaime-sense

I have tested this on windows and can confirm it works perfectly. I was having this exact issue when running discovery on multiple NICs.

esarver avatar Aug 09 '22 15:08 esarver

@dylanmckay is there something holding this PR up? I would be happy to help get it merged. I haven't tested this patch against the latest version, though there doesn't appear to be any conflicts (according to GitHub). The MDNS search doesn't work properly for me without this change.

esarver avatar Mar 07 '24 16:03 esarver

I have once again tested these changes against 3.0.0 and it works perfectly (on Windows. I have not tested on Linux yet).

esarver avatar Mar 07 '24 16:03 esarver