mdns: restrict A/AAAA records to addresses reachable from querying interface #125
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.
(Sorry fo my broken English)
This PR fixes #43 .
The Problem
As a reminder, when I Register() a service on a machine A (with multiple network interfaces, let say an ethernet NIC, a wireless connection on the same network as the ethernet NIC, and VPN connection and a docker bridge), and then if I browse for a service from another machine B with an ethernet NIC (the same network as the ethernet NIC and the wireless connection for the machine A), then I receive an answer specifying IP addresses for the ethernet NIC, the wireless adapter, the vpn connection and the docker bridge. The last two ip addresses are not routable/accessible from machine B. As a consequence they are not valid.
Background
This PR is based on this extract from the RFC 6762:
Found in section "14. Considerations for Multiple Interfaces".
Solution
The PR's commits propose to check that IP Addresses added to an answer are actually contained in the originating network (the network from where the request is coming from).