Skip Menu |
 

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

Report information
The Basics
Id: 101381
Status: new
Priority: 0/
Queue: IO-Socket-INET6

People
Owner: Nobody in particular
Requestors: oleg [...] cpan.org
Cc:
AdminCc:

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



Subject: Server with unspecified LocalAddr and LocalPort failed to start on Windows
Download (untitled) / with headers
text/plain 411b
Test example: use strict; use lib 'IO-Socket-INET6-2.72/lib/'; use IO::Socket::INET6; my $srv = IO::Socket::INET6->new(Listen => 1) or die $@; warn "Server started at [", $srv->sockhost, ']:', $srv->sockport; __END__ Both windows 7 and windows xp dies with "IO::Socket::INET6: listen: Invalid argument at t.pl line 5." After this patch all works as expected. I also removed unnecessary sockaddr_in() calls.
Subject: need-to-bind-win32.patch
--- lib/IO/Socket/INET6.pm.orig 2015-01-07 23:19:11.163130587 +0600 +++ lib/IO/Socket/INET6.pm 2015-01-07 23:37:37.484539116 +0600 @@ -251,13 +251,9 @@ } if ( $family == AF_INET ) { - my ($p,$a) = sockaddr_in($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne INADDR_ANY or $p!=0); + $sock->bind($lres) or return _error($sock, $!, "bind: $!"); } else { - my ($p,$a) = sockaddr_in6($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne in6addr_any or $p!=0); + $sock->bind($lres) or return _error($sock, $!, "bind: $!"); } if(exists $arg->{Listen}) {
Download (untitled) / with headers
text/plain 520b
On Wed Jan 07 12:38:34 2015, OLEG wrote: Show quoted text
> Test example: > use strict; > use lib 'IO-Socket-INET6-2.72/lib/'; > use IO::Socket::INET6; > > my $srv = IO::Socket::INET6->new(Listen => 1) > or die $@; > > warn "Server started at [", $srv->sockhost, ']:', $srv->sockport; > __END__ > > Both windows 7 and windows xp dies with "IO::Socket::INET6: listen: > Invalid argument at t.pl line 5." > After this patch all works as expected. I also removed unnecessary > sockaddr_in() calls.
BTW, patch may simplified to:
Subject: need-to-bind-win32.patch
--- lib/IO/Socket/INET6.pm.orig 2015-01-07 23:19:11.163130587 +0600 +++ lib/IO/Socket/INET6.pm 2015-01-07 23:52:08.260796135 +0600 @@ -250,15 +250,7 @@ return _error($sock, $!, "sockopt: $!"); } - if ( $family == AF_INET ) { - my ($p,$a) = sockaddr_in($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne INADDR_ANY or $p!=0); - } else { - my ($p,$a) = sockaddr_in6($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne in6addr_any or $p!=0); - } + $sock->bind($lres) or return _error($sock, $!, "bind: $!"); if(exists $arg->{Listen}) { $sock->listen($arg->{Listen} || 5) or
Download (untitled) / with headers
text/plain 662b
On Wed Jan 07 12:53:19 2015, OLEG wrote: Show quoted text
> On Wed Jan 07 12:38:34 2015, OLEG wrote:
> > Test example: > > use strict; > > use lib 'IO-Socket-INET6-2.72/lib/'; > > use IO::Socket::INET6; > > > > my $srv = IO::Socket::INET6->new(Listen => 1) > > or die $@; > > > > warn "Server started at [", $srv->sockhost, ']:', $srv->sockport; > > __END__ > > > > Both windows 7 and windows xp dies with "IO::Socket::INET6: listen: > > Invalid argument at t.pl line 5." > > After this patch all works as expected. I also removed unnecessary > > sockaddr_in() calls.
> > > BTW, patch may simplified to:
And since it only fails for listen() patch may be changed to:
Subject: need-to-bind-win32.patch
--- lib/IO/Socket/INET6.pm.orig 2015-01-07 23:19:11.163130587 +0600 +++ lib/IO/Socket/INET6.pm 2015-01-08 12:23:11.466194769 +0600 @@ -250,17 +250,9 @@ return _error($sock, $!, "sockopt: $!"); } - if ( $family == AF_INET ) { - my ($p,$a) = sockaddr_in($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne INADDR_ANY or $p!=0); - } else { - my ($p,$a) = sockaddr_in6($lres); - $sock->bind($lres) or return _error($sock, $!, "bind: $!") - if ($a ne in6addr_any or $p!=0); - } - if(exists $arg->{Listen}) { + $sock->bind($lres) or + return _error($sock, $!, "bind: $!"); $sock->listen($arg->{Listen} || 5) or return _error($sock, $!, "listen: $!"); }
Download (untitled) / with headers
text/plain 867b
On Thu Jan 08 01:25:31 2015, OLEG wrote: Show quoted text
> On Wed Jan 07 12:53:19 2015, OLEG wrote:
> > On Wed Jan 07 12:38:34 2015, OLEG wrote:
> > > Test example: > > > use strict; > > > use lib 'IO-Socket-INET6-2.72/lib/'; > > > use IO::Socket::INET6; > > > > > > my $srv = IO::Socket::INET6->new(Listen => 1) > > > or die $@; > > > > > > warn "Server started at [", $srv->sockhost, ']:', $srv->sockport; > > > __END__ > > > > > > Both windows 7 and windows xp dies with "IO::Socket::INET6: listen: > > > Invalid argument at t.pl line 5." > > > After this patch all works as expected. I also removed unnecessary > > > sockaddr_in() calls.
> > > > > > BTW, patch may simplified to:
> > And since it only fails for listen() patch may be changed to:
Oops, forgive my last patch. This will prevent bind() when user specified LocalAddr for connect. Previous was correct.


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.