Skip Menu |
 

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

Report information
The Basics
Id: 90238
Status: resolved
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Nobody in particular
Requestors: Torsten.Werner [...] assyst.de
Cc:
AdminCc:

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



Subject: problem in IO::Socket::SSL 1.956 for servers with multiple IPv4 addresses
Date: Mon, 11 Nov 2013 11:04:14 +0100
To: bug-IO-Socket-SSL [...] rt.cpan.org
From: Torsten.Werner [...] assyst.de
Download (untitled) / with headers
text/plain 2.2k
Hi, the method "configure" contains the following sequence: if ( $can_ipv6 && ! $arg_hash->{Domain} && ! ( $arg_hash->{LocalAddr} || $arg_hash->{LocalHost} ) && (my $peer = $arg_hash->{PeerAddr} || $arg_hash->{PeerHost})) { # set Domain to AF_INET/AF_INET6 if there is only one choice ($peer, my $port) = IO::Socket::INET6::_sock_info( $peer,$arg_hash->{PeerPort},6 ); my @res = Socket6::getaddrinfo( $peer,$port,AF_UNSPEC,SOCK_STREAM ); if (@res == 5) { # <--- this is not true for servers with more then one addresses $arg_hash->{Domain} = $res[0]; DEBUG(2,'set domain to '.$res[0] ); } } the problem is the result of Socket6::getaddrinfo. This function may return arrays with 5, 10, 15, ... members depending on the number of IP addresses of the host. The following would fix it: if ( $can_ipv6 && ! $arg_hash->{Domain} && ! ( $arg_hash->{LocalAddr} || $arg_hash->{LocalHost} ) && (my $peer = $arg_hash->{PeerAddr} || $arg_hash->{PeerHost})) { # set Domain to AF_INET/AF_INET6 if there is only one choice ($peer, my $port) = IO::Socket::INET6::_sock_info( $peer,$arg_hash->{PeerPort},6 ); my @res = Socket6::getaddrinfo( $peer,$port,AF_UNSPEC,SOCK_STREAM ); unless (scalar(@res) % 5) { INFO: while (scalar(my @_res=splice(@res,0,5))) { $arg_hash->{Domain} = $_res[0]; DEBUG(2,'set domain to '.$_res[0] ); last INFO if $_res[0]==23; } } } Bye Torsten ---------------------------------------------------------------------- Assyst GmbH Dr. Ing. Torsten Werner Product Manager plan.assyst Max-Planck-Str. 3 85609 Aschheim-Dornach Germany Phone: +49 (0)89 90505-0 Fax: +49 (0)89 90505-271 E-Mail: torsten.werner@assyst.de Internet: http://www.assyst.de Geschäftsführer: Dr. Andreas Seidl Eingetragen beim Registergericht München HRB 180174 Sitz der Gesellschaft: 85609 Aschheim-Dornach ----------------------------------------------------------------------
Download (untitled) / with headers
text/plain 557b
Am Mo 11. Nov 2013, 05:04:35, Torsten.Werner@assyst.de schrieb: Show quoted text
> Hi, > > the method "configure" contains the following sequence: > > if ( $can_ipv6 && ! $arg_hash->{Domain} &&
contrary to the subject the code cannot be from 1.956 - this must be at most version 1.74. Also, the code clearly states that it is a workaround for a bug in IO::Socket::INET6 where it fails to figure out the domain by itself. I will remove the workaround for the bug which was fixed 5 years ago and require instead a newer IO::Socket::INET6 version. Regards, Steffen


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.