Skip Menu |

This queue is for tickets about the IO-Socket-INET6 CPAN distribution.

Report information
The Basics
Id: 54656
Status: resolved
Priority: 0/
Queue: IO-Socket-INET6

People
Owner: Nobody in particular
Requestors: Steffen_Ullrich [...] genua.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Enhancement/OpenBSD-Workaround for IO::Socket::INET6 (patch included)
Date: Tue, 16 Feb 2010 13:55:43 +0100
To: bug-IO-Socket-INET6 [...] rt.cpan.org
From: Steffen Ullrich <Steffen_Ullrich [...] genua.de>
Hi, I've just noticed, that OpenBSD getaddrinfo behaves strange, in that getaddrinfo( ipv4,AF_INET6 ) causes a DNS lookup. This call will happen in the FAMILY_LOOP in sub configure if you do just a simple IO::Socket::INET6->new('ipv4:port'), which is a common scenario. Attached patch works around the problem by limiting the family if LocalAddr or PeerAddr are IPs. It's fairly simple and I've tested it on OpenBSD. Alle test from 2.57 run with this patch, except pod-coverage.t which fails already in plain 2.57. Keep up the good work, Regards, Steffen -- GeNUA Gesellschaft für Netzwerk - und Unix-Administration mbH Domagkstr. 7, D-85551 Kirchheim. http://www.genua.de Tel: (089) 99 19 50-0, Fax: (089) 99 10 50 - 999 Geschäftsführer: Dr. Magnus Harlander, Dr. Michaela Harlander, Bernhard Schneck. Amtsgericht München HRB 98238

Message body is not shown because sender requested not to inline it.

From: paul [...] city-fan.org
The addition of this patch in 2.58 appears to have broken builds with perl < 5.10.0, such as in http://www.cpantesters.org/cpan/report/6954057 Attached patch fixes the issue for me, at least back to 5.8.0 which is the oldest perl I have to test with.
Subject: perl-IO-Socket-INET6-2.58-syntax.patch
--- IO-Socket-INET6-2.58/lib/IO/Socket/INET6.pm 2010-03-18 12:05:48.000000000 +0000 +++ IO-Socket-INET6-2.58/lib/IO/Socket/INET6.pm 2010-03-19 10:28:31.916244865 +0000 @@ -229,9 +229,9 @@ return _error($sock, $!, "sockopt: $!"); } - if( $family == AF_INET - ? (sockaddr_in($lres))[1] ne INADDR_ANY - : (sockaddr_in6($lres))[1] ne in6addr_any ) { + if( ( $family == AF_INET ) + ? ((sockaddr_in($lres))[1] ne INADDR_ANY) + : ((sockaddr_in6($lres))[1] ne in6addr_any) ) { $sock->bind($lres) or return _error($sock, $!, "bind: $!"); }
On Fri Mar 19 06:38:24 2010, paul@city-fan.org wrote: Show quoted text
> The addition of this patch in 2.58 appears to have broken builds with > perl < 5.10.0, such as in http://www.cpantesters.org/cpan/report/6954057 > > Attached patch fixes the issue for me, at least back to 5.8.0 which is > the oldest perl I have to test with.
Thanks! Applied in 2.59 , which has been released. Regards, -- Shlomi Fish