mdns: restrict A/AAAA records to addresses reachable from querying interface#125
mdns: restrict A/AAAA records to addresses reachable from querying interface#125yifu wants to merge 1 commit intograndcat:masterfrom
Conversation
…terface; add filterAddrsForNetwork and fallback to interface’s own addresses when none match. Avoids advertising unreachable IPs.
|
As a side note: unit tests do not work on
|
(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).