Add support for publishing on IPv6 networks #19
Merged
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.
♻️ Current situation
Ciao, while it can publish AAAA records over IPv4, cannot publish any records at all over IPv6. This means that on IPv6-only networks, or people who are using routers with broken IPv4 multicast support (Arris and CenturyLink - I am talking about you!), Ciao does not work. 'No Response'!
💡 Proposed solution
I recently made a PR for HAP-NodeJS which adds Avahi/D-Bus as a new advertiser. This supports IPv6 and generally I would recommend it. But some platforms don't/can't have Avahi, e.g. macOS and Windows. So there's still a hole.
So here is a PR to bridge that gap, and add IPv6 publishing to Ciao (which otherwise is pretty complete).
⚙️ Release Notes
MDNSServer.options now adds a new advertiseIpv6 option. It defaults to false, but if you set it to true it'll publish over IPv6.
Testing
Not done much, but I have tested these things on macOS and Linux, and they at least superficially work: (adding, deleting, updating records)
I made the decision to implement IPv6 support by effectively creating "wrapper interfaces" around IPv6-capable network interfaces, which then get special treatment to handle IPv6 vs. IPv4 differences. Out of all possible approaches this keeps the largest proportion of the existing Ciao code intact, which I felt was important because it is very easy with mDNS to subtly break things. (I don't promise I haven't already done that, unfortunately.)
For completeness, it is probably worth adding equivalents to Avahi's publish-aaaa-on-ipv4 and publish-a-on-ipv6 options.