When debugging an issue in Discussions #260 , I installed docker on macOS, and the test case integration_success fails intermittently.
With some digging, it seems that: there are IPv6 interfaces that have more than 1 IPv6 address configured. I.e. same interface name same interface index, but different IPv6 address. Because IPv6 sockets joins multicast using their index, not the address, there are two sockets receive packets for both addresses. Depends on the timing, one of the addresses could be flushed by another one and cause the resolved service has less addresses than expected.
The following log shows this happened with two cases, and resolved 16 addr(s) instead of expected 18 addr(s):
This patch adds a check for cache flush: for address records, we only flush if the incoming address and the existing address are on the same network of the interface.
Also, changed a error log into a debug log per the discussions comment.
When debugging an issue in Discussions #260 , I installed
docker
on macOS, and the test caseintegration_success
fails intermittently.With some digging, it seems that: there are IPv6 interfaces that have more than 1 IPv6 address configured. I.e. same interface name same interface index, but different IPv6 address. Because IPv6 sockets joins multicast using their index, not the address, there are two sockets receive packets for both addresses. Depends on the timing, one of the addresses could be flushed by another one and cause the resolved service has less addresses than expected.
The following log shows this happened with two cases, and resolved 16 addr(s) instead of expected 18 addr(s):
This patch adds a check for cache flush: for address records, we only flush if the incoming address and the existing address are on the same network of the interface.
Also, changed a error log into a debug log per the discussions comment.