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.
I also ran into the issue with multiple interfaces (#25). Starting from #26 I tested it using a setup with multiple interfaces and found some additional scenarios, where I would suggest some further improvements.
I ran into the problem, that the non-reachable address records were removed from the message, but the message was sent on every available interface; Because of that, services were announced on interfaces where they can not be reached (although the address record was removed);
I ran into this problem when calling Announce(). Since there is no defined destination IP when calling announce, every address record was sent over every interface;
I ran into this problem when I tried to query the same service from two different interfaces. The query is the same, but as the query comes from a different interface it should be answered nonetheless. The new answer will include new address records, as other addresses may be reachable from the interface of the new querier.
I included these changes and tested everything on my multiple interface setup. Everything seems to work fine for me, but hopefully, someone can crosscheck. Since I am new to the open-source-community I am glad about feedback.
I appreciate your work and would find it very useful if this PR could be merged. It would simplify the work on multiple interface setups a lot.