Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, fantastic library I am over the moon to be rid of my C dependency on libavahi-client!
However, I've experienced some pretty strange behavior - using two wired connections, I am only able to discover services on one of them at a time. Even more strangely, which wired connection is used is random for each invocation of the program! I think I've traced the source to this change
545631a
It seems the intent was to not send multiple queries to the same subnet, but the implementation instead ended up excluding any networks that use the same netmask.
As an example, my two wired connections both have the netmask 255.255.255.0, but their ip addresses and therefore subnets are completely different. Since the interfaces are stored in a hashmap, this lead to some rather strange behavior in which the order of iteration of the hashmap (which is random for each invocation of the hashmap) determined which interface was allowed to be used.
The fix seems pretty simple - get the subnet of the interface by a bitwise & of the address and the netmask and use this to check if we've already sent on that subnet.
Again, thanks for the library :)