feat: add IPv6 support via IO::Socket::IP#66
Draft
toddr-bot wants to merge 2 commits into
Draft
Conversation
Prefer IO::Socket::IP (core since Perl 5.20) over IO::Socket::INET for transparent dual-stack IPv4/IPv6 support. Falls back to IO::Socket::INET on older Perls, preserving backward compatibility. Key changes: - Daemon.pm/Test.pm: use $INET_CLASS resolved at load time - Accept(): handle IPv4-mapped IPv6 addresses (::ffff:x.x.x.x) so existing IPv4 ACL masks continue to work on dual-stack sockets - New t/ipv6.t: 7 tests covering class selection and ACL normalization - POD: document IPv6 support and --localaddr IPv6 usage Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
IO::Socket::IP with no LocalAddr may bind to :: (dual-stack IPv6) on some platforms. Test clients use IO::Socket::INET to connect to 127.0.0.1, which can't reach an IPv6-only listener on Windows. Default the test server's LocalAddr to 127.0.0.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Add transparent IPv6 support by preferring IO::Socket::IP over IO::Socket::INET.
Why
Net::Daemon only supports IPv4. IO::Socket::IP has been in Perl core since 5.20 (2014) and is a drop-in replacement that enables dual-stack IPv4/IPv6 listening with zero configuration change. This lets daemon subclasses accept IPv6 clients without any code modification.
How
$Net::Daemon::INET_CLASSis resolved once at load time: IO::Socket::IP if available, IO::Socket::INET otherwise. Both Daemon.pm and Test.pm use this class for TCP server sockets.::ffff:x.x.x.x) that appear on dual-stack sockets. The bare IPv4 address is extracted forgethostbyaddr()and added to the ACL pattern list, so existing IPv4 regex masks keep working unchanged.peerhost()calls with a proto check — IO::Socket::UNIX doesn't implement this method.Testing
🤖 Generated with Claude Code
Quality Report
Changes: 3 files changed, 127 insertions(+), 7 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline