Bug#732999: X11::Protocol fails to connect to X servers over IPv6

Ivan Shmakov ivan at siamics.net
Mon Dec 23 18:54:58 UTC 2013


Package: libx11-protocol-perl
Version: 0.56-4
Tags: ipv6, patch

	The INETSocket.pm module, as used by X11::Protocol, does
	currently rely on IO::Socket::INET, thus supporting connections
	over IPv4 only.

	The fix is rather straightforward: the IO::Socket::INET6 class
	(which supports /both/ IPv6 /and/ IPv4) is to be checked at
	run-time, and, if available, used instead of IO::Socket::INET.
	(Much like the fix I’ve suggested [1] for Bug#306914.)

	An (untested) change is MIMEd.

	As a work-around, the software using X11::Protocol may simply
	“redirect” the IO::Socket::INET->new () class constructor to
	IO::Socket::INET6->new (), like:

require IO::Socket::INET;
require IO::Socket::INET6;

*IO::Socket::INET::new = sub {
    my ($class, @args) = @_;
    ## .
    IO::Socket::INET6->new (@args);
};

	As a side effect, this may actually enable IPv6 support in all
	the other Perl code that uses IO::Socket::INET.  (Potentially
	breaking it with unexpected values of ->peerhost (), etc.)

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=306914#68

-- 
FSF associate member #7257
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-perl
Size: 673 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20131223/dba6adcb/attachment.pl>


More information about the pkg-perl-maintainers mailing list