Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for publishing on IPv6 networks #19

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

adriancable
Copy link

@adriancable adriancable commented Jan 17, 2022

♻️ 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)

  • advertising IPv4 only on IPv4-only networks
  • advertising IPv6 only on IPv6-only networks
  • advertising IPv4 only on dual stack networks
  • advertising IPv6 only on dual stack networks
  • advertising IPv4 and IPv6 on dual stack networks

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.

@coveralls
Copy link

coveralls commented Jan 17, 2022

Pull Request Test Coverage Report for Build 1706679682

  • 0 of 72 (0.0%) changed or added relevant lines in 2 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.7%) to 35.089%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Responder.ts 0 12 0.0%
src/MDNSServer.ts 0 60 0.0%
Files with Coverage Reduction New Missed Lines %
src/Responder.ts 1 0%
src/MDNSServer.ts 5 6.92%
Totals Coverage Status
Change from base Build 1491628923: -0.7%
Covered Lines: 1200
Relevant Lines: 3085

💛 - Coveralls

@california444
Copy link

HI,
are there any plans to merge this PR to support IPv6 for ciao in the near future?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants