Hello community,
here is the log from the commit of package perl-IO-Socket-INET6 for openSUSE:Factory
checked in at Fri Mar 26 16:49:24 CET 2010.
--------
--- perl-IO-Socket-INET6/perl-IO-Socket-INET6.changes 2010-01-13 17:08:19.000000000 +0100
+++ perl-IO-Socket-INET6/perl-IO-Socket-INET6.changes 2010-03-26 11:44:09.000000000 +0100
@@ -1,0 +2,10 @@
+Thu Mar 25 17:41:26 CET 2010 - anicka@suse.cz
+
+- update to 2.61
+ * Fix the inet_pton / inet_ntop import warnings
+ * Fix listening on :: or 0.0.0.0 - a random address instead of
+ the specified would be used. Added test listen_port_only.t
+ * Fixes to t/listen_port_only.t.
+ * Syntax change to adapt for older Perls
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
IO-Socket-INET6-2.57.tar.bz2
New:
----
IO-Socket-INET6-2.61.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-IO-Socket-INET6.spec ++++++
--- /var/tmp/diff_new_pack.SmAczy/_old 2010-03-26 16:48:13.000000000 +0100
+++ /var/tmp/diff_new_pack.SmAczy/_new 2010-03-26 16:48:13.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package perl-IO-Socket-INET6 (Version 2.57)
+# spec file for package perl-IO-Socket-INET6 (Version 2.61)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,7 +20,7 @@
Name: perl-IO-Socket-INET6
BuildRequires: perl-Socket6
-Version: 2.57
+Version: 2.61
Release: 1
Requires: perl = %{perl_version}
Requires: perl-Socket6
++++++ IO-Socket-INET6-2.57.tar.bz2 -> IO-Socket-INET6-2.61.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/Build.PL new/IO-Socket-INET6-2.61/Build.PL
--- old/IO-Socket-INET6-2.57/Build.PL 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/Build.PL 2010-03-25 09:45:16.000000000 +0100
@@ -1,13 +1,22 @@
use strict;
+use warnings;
-use Module::Build;
+use lib "./inc";
-my $build = Module::Build->new(
+use Test::Run::Builder;
+
+my $build = Test::Run::Builder->new(
'module_name' => "IO::Socket::INET6",
'requires' =>
{
+ 'Carp' => 0,
+ 'Errno' => 0,
+ 'Exporter' => 0,
'IO::Socket' => 0,
+ 'Socket' => 0,
'Socket6' => "0.12",
+ 'strict' => 0,
+ 'warnings' => 0,
},
build_requires =>
{
@@ -15,5 +24,25 @@
},
'license' => "perl",
create_makefile_pl => 'traditional',
+ meta_merge =>
+ {
+ resources =>
+ {
+ repository => "http://svn.berlios.de/svnroot/repos/web-cpan/IO-Socket-INET6/",
+ },
+ keywords =>
+ [
+ "inet6",
+ "input",
+ "internet",
+ "ipv6",
+ "network",
+ "networking",
+ "output",
+ "socket",
+ "sockets",
+ ],
+ },
+
);
$build->create_build_script;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/ChangeLog new/IO-Socket-INET6-2.61/ChangeLog
--- old/IO-Socket-INET6-2.57/ChangeLog 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/ChangeLog 2010-03-25 09:45:16.000000000 +0100
@@ -1,8 +1,32 @@
+2010-03-25 Shlomi Fish
+ * Fix the inet_pton / inet_ntop import warnings:
+ - https://rt.cpan.org/Ticket/Display.html?id=55901
+ - Thanks to Todd Rinaldo for the patch.
+ * Fix listening on :: or 0.0.0.0 - a random address instead of
+ the specified would be used. Added test listen_port_only.t
+ - Regression from 2.57:
+ - https://rt.cpan.org/Ticket/Display.html?id=54656
+ - Thanks to Steffen Ullrich for the patch.
+ * New Release IO-Socket-INET6-2.60
+ * Fixes to t/listen_port_only.t.
+ * New Release IO-Socket-INET6-2.61
+
+2010-03-19 Shlomi Fish
+ * Syntax change to adapt for older Perls:
+ - https://rt.cpan.org/Ticket/Display.html?id=54656
+ - Thanks to paul.
+ * New Release IO-Socket-INET6-2.59
+
+2010-03-18 Shlomi Fish
+ * Applied a patch by Steffen Ullrich, fixing:
+ https://rt.cpan.org/Ticket/Display.html?id=54656
+ * New Release IO-Socket-INET6-2.58
+
2009-11-23 Shlomi Fish
* Applied a modified version of a patch by Matthew Horsfall
in order to add t/blocking.t and deal with the
blocking sockets properly.
- * New Release IO-Scoket-INET6-2.57
+ * New Release IO-Socket-INET6-2.57
2008-10-06 Shlomi Fish
* Applied a modified version of a patch by Anicka Bernathova
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/MANIFEST new/IO-Socket-INET6-2.61/MANIFEST
--- old/IO-Socket-INET6-2.57/MANIFEST 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/MANIFEST 2010-03-25 09:45:16.000000000 +0100
@@ -1,5 +1,6 @@
Build.PL
ChangeLog
+inc/Test/Run/Builder.pm
lib/IO/Socket/INET6.pm
Makefile.PL
MANIFEST
@@ -11,5 +12,6 @@
t/io_multihomed6.t
t/io_sock6.t
t/io_udp6.t
+t/listen_port_only.t
t/pod-coverage.t
t/pod.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/META.yml new/IO-Socket-INET6-2.61/META.yml
--- old/IO-Socket-INET6-2.57/META.yml 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/META.yml 2010-03-25 09:45:16.000000000 +0100
@@ -1,32 +1,43 @@
---
-name: IO-Socket-INET6
-version: 2.57
+abstract: 'Object interface for AF_INET|AF_INET6 domain sockets'
author:
- - |-
- This program is based on LIO::Socket::INET by Graham Barr
- and currently maintained by the Perl Porters.
- - |-
- Modified by Rafael Martinez Torres and
- Euro6IX project.
- - |-
- Modified further by Shlomi Fish , while disclaiming
- all copyrights.
-abstract: Object interface for AF_INET|AF_INET6 domain sockets
-license: perl
-resources:
- license: http://dev.perl.org/licenses/
+ - "This program is based on LIO::Socket::INET by Graham Barr\n and currently maintained by the Perl Porters."
+ - "Modified by Rafael Martinez Torres and\nEuro6IX project."
+ - "Modified further by Shlomi Fish , while disclaiming\nall copyrights."
build_requires:
Test::More: 0
-requires:
- IO::Socket: 0
- Socket6: 0.12
configure_requires:
- Module::Build: 0.35
-provides:
- IO::Socket::INET6:
- file: lib/IO/Socket/INET6.pm
- version: 2.57
-generated_by: Module::Build version 0.35
+ Module::Build: 0.36
+generated_by: 'Module::Build version 0.3603'
+keywords:
+ - inet6
+ - input
+ - internet
+ - ipv6
+ - network
+ - networking
+ - output
+ - socket
+ - sockets
+license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
+name: IO-Socket-INET6
+provides:
+ IO::Socket::INET6:
+ file: lib/IO/Socket/INET6.pm
+ version: 2.61
+requires:
+ Carp: 0
+ Errno: 0
+ Exporter: 0
+ IO::Socket: 0
+ Socket: 0
+ Socket6: 0.12
+ strict: 0
+ warnings: 0
+resources:
+ license: http://dev.perl.org/licenses/
+ repository: http://svn.berlios.de/svnroot/repos/web-cpan/IO-Socket-INET6/
+version: 2.61
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/Makefile.PL new/IO-Socket-INET6-2.61/Makefile.PL
--- old/IO-Socket-INET6-2.57/Makefile.PL 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/Makefile.PL 2010-03-25 09:45:16.000000000 +0100
@@ -1,13 +1,19 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.35
+# Note: this file was auto-generated by Module::Build::Compat version 0.3603
use ExtUtils::MakeMaker;
WriteMakefile
(
'NAME' => 'IO::Socket::INET6',
'VERSION_FROM' => 'lib/IO/Socket/INET6.pm',
'PREREQ_PM' => {
+ 'Carp' => 0,
+ 'Errno' => 0,
+ 'Exporter' => 0,
'IO::Socket' => 0,
+ 'Socket' => 0,
'Socket6' => '0.12',
- 'Test::More' => 0
+ 'Test::More' => 0,
+ 'strict' => 0,
+ 'warnings' => 0
},
'INSTALLDIRS' => 'site',
'EXE_FILES' => [],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/inc/Test/Run/Builder.pm new/IO-Socket-INET6-2.61/inc/Test/Run/Builder.pm
--- old/IO-Socket-INET6-2.57/inc/Test/Run/Builder.pm 1970-01-01 01:00:00.000000000 +0100
+++ new/IO-Socket-INET6-2.61/inc/Test/Run/Builder.pm 2010-03-25 09:45:16.000000000 +0100
@@ -0,0 +1,76 @@
+package Test::Run::Builder;
+
+use strict;
+use warnings;
+
+use Module::Build;
+
+use vars qw(@ISA);
+
+@ISA = (qw(Module::Build));
+
+sub ACTION_runtest
+{
+ my ($self) = @_;
+ my $p = $self->{properties};
+
+ $self->depends_on('code');
+
+ local @INC = @INC;
+
+ # Make sure we test the module in blib/
+ unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'),
+ File::Spec->catdir($p->{base_dir}, $self->blib, 'arch'));
+
+ $self->do_test_run_tests;
+}
+
+sub ACTION_distruntest {
+ my ($self) = @_;
+
+ $self->depends_on('distdir');
+
+ my $start_dir = $self->cwd;
+ my $dist_dir = $self->dist_dir;
+ chdir $dist_dir or die "Cannot chdir to $dist_dir: $!";
+ # XXX could be different names for scripts
+
+ $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile
+ or die "Error executing 'Build.PL' in dist directory: $!";
+ $self->run_perl_script('Build')
+ or die "Error executing 'Build' in dist directory: $!";
+ $self->run_perl_script('Build', [], ['runtest'])
+ or die "Error executing 'Build test' in dist directory";
+ chdir $start_dir;
+}
+
+sub do_test_run_tests
+{
+ my $self = shift;
+
+ require Test::Run::CmdLine::Iface;
+
+ my $test_run =
+ Test::Run::CmdLine::Iface->new(
+ {
+ 'test_files' => [glob("t/*.t")],
+ }
+ # 'backend_params' => $self->_get_backend_params(),
+ );
+
+ return $test_run->run();
+}
+
+sub ACTION_tags
+{
+ return
+ system(qw(
+ ctags -f tags --recurse --totals
+ --exclude=blib/** --exclude=t/lib/**
+ --exclude=.svn --exclude='*~'
+ --languages=Perl --langmap=Perl:+.t
+ ));
+}
+
+1;
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/lib/IO/Socket/INET6.pm new/IO-Socket-INET6-2.61/lib/IO/Socket/INET6.pm
--- old/IO-Socket-INET6-2.57/lib/IO/Socket/INET6.pm 2009-11-22 23:20:36.000000000 +0100
+++ new/IO-Socket-INET6-2.61/lib/IO/Socket/INET6.pm 2010-03-25 09:45:16.000000000 +0100
@@ -18,8 +18,8 @@
# IO::Socket and Socket already import stuff here - possibly AF_INET6
# and PF_INET6 so selectively import things from Socket6.
use Socket6 (
- qw(AI_PASSIVE inet_ntop inet_pton getaddrinfo
- sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all)
+ qw(AI_PASSIVE getaddrinfo
+ sockaddr_in6 unpack_sockaddr_in6_all pack_sockaddr_in6_all in6addr_any)
);
use Carp;
@@ -27,7 +27,7 @@
use Errno;
@ISA = qw(IO::Socket);
-$VERSION = "2.57";
+$VERSION = "2.61";
#Purpose: allow protocol independent protocol and original interface.
my $EINVAL = exists(&Errno::EINVAL) ? Errno::EINVAL() : 1;
@@ -55,7 +55,7 @@
my @serv = ();
if (defined $addr) {
- if (!inet_pton(AF_INET6,$addr)) {
+ if (!Socket6::inet_pton(AF_INET6,$addr)) {
if($addr =~ s,^\[([\da-fA-F:]+)\]:([\w\(\)/]+)$,$1,) {
$port = $2;
} elsif($addr =~ s,^\[(::[\da-fA-F.:]+)\]:([\w\(\)/]+)$,$1,) {
@@ -120,21 +120,29 @@
sub configure {
my($sock,$arg) = @_;
- my($lport,$rport,$laddr,$rpoty,$raddr,$family,$proto,$type);
- my($lres,$rres);
$arg->{LocalAddr} = $arg->{LocalHost}
- if exists $arg->{LocalHost} && !exists $arg->{LocalAddr};
-
- # Syntax Parsing...
- ($laddr,$lport,$proto) = _sock_info($arg->{LocalAddr},
- $arg->{LocalPort},
- $arg->{Proto})
- or return _error($sock, $!, "sock_info: $@");
+ if exists $arg->{LocalHost} && !exists $arg->{LocalAddr};
+ $arg->{PeerAddr} = $arg->{PeerHost}
+ if exists $arg->{PeerHost} && !exists $arg->{PeerAddr};
+ my $family = $arg->{Domain};
+ # in case no local and peer is given we prefer AF_INET6
+ # because we are IO::Socket::INET6
+ $family ||= ! $arg->{LocalAddr} && ! $arg->{PeerAddr} && AF_INET6
+ || AF_UNSPEC;
+
+ # parse Local*
+ my ($laddr,$lport,$proto) = _sock_info(
+ $arg->{LocalAddr},
+ $arg->{LocalPort},
+ $arg->{Proto}
+ ) or return _error($sock, $!, "sock_info: $@");
$laddr ||= '';
$lport ||= 0;
- $family = $arg->{Domain} || AF_UNSPEC;
+ $proto ||= (getprotobyname('tcp'))[2];
+
+
# MSWin32 expects at least one of $laddr or $lport to be specified
# and does not accept 0 for $lport if $laddr is specified.
if ($^O eq 'MSWin32') {
@@ -145,175 +153,118 @@
$lport = '';
}
}
- $proto ||= (getprotobyname('tcp'))[2];
- $type = $arg->{Type} || $socket_type{(getprotobynumber($proto))[0]};
- $arg->{PeerAddr} = $arg->{PeerHost}
- if exists $arg->{PeerHost} && !exists $arg->{PeerAddr};
+ my $type = $arg->{Type} || $socket_type{(getprotobynumber($proto))[0]};
+ # parse Peer*
+ my($rport,$raddr);
unless(exists $arg->{Listen}) {
- ($raddr,$rport,$proto) = _sock_info($arg->{PeerAddr},$arg->{PeerPort},
- $proto)
- or return _error($sock, $!, "sock_info: $@");
- }
-
- # Previously IO-Socket-INET6 tried to bind even when one side
- # is AF_INET and the other AF_INET6 and this cannot work.
- #
- # The FAMILY_CHECK loop is meant to make sure both sides have
- # the same family.
-
- my @families;
- if ($family == AF_UNSPEC) {
- @families = (AF_INET6, AF_INET);
- } else {
- @families = ($family);
+ ($raddr,$rport) = _sock_info(
+ $arg->{PeerAddr},
+ $arg->{PeerPort},
+ $proto
+ ) or return _error($sock, $!, "sock_info: $@");
}
- my $ok = 0;
- my $msg;
-
- my @lres;
+ # find out all combinations of local and remote addr with
+ # the same family
+ my @lres = getaddrinfo($laddr,$lport,$family,$type,$proto,AI_PASSIVE);
+ return _error($sock, $EINVAL, "getaddrinfo: $lres[0]") if @lres<5;
my @rres;
+ if ( defined $raddr ) {
+ @rres = getaddrinfo($raddr,$rport,$family,$type,$proto);
+ return _error($sock, $EINVAL, "getaddrinfo: $rres[0]") if @rres<5;
+ }
- FAMILY_CHECK:
- for my $fam (@families) {
-
- @lres = getaddrinfo(
- $laddr,$lport,$fam,$type,$proto,AI_PASSIVE
- );
-
- if (scalar(@lres) < 5) {
- $msg = $lres[0];
- next FAMILY_CHECK;
- }
-
- if (defined $raddr) {
- @rres = getaddrinfo(
- $raddr,$rport,$fam,$type,$proto,AI_PASSIVE
- );
-
- if (scalar(@rres) >= 5) {
- $ok = 1;
- last FAMILY_CHECK;
+ my @flr;
+ for( my $l=0;$l<@lres;$l+=5) {
+ my $fam_listen = $lres[$l];
+ my $lsockaddr = $lres[$l+3];
+ if (@rres) {
+ # collect all combinations whith the same family in lres and rres
+ for( my $r=0;$r<@rres;$r+=5 ) {
+ next if $rres[0] != $fam_listen; # must be same family
+ push @flr,[ $fam_listen,$lsockaddr,$rres[$r+3] ];
}
- else {
- $msg = $rres[0];
- }
- }
- else {
- $ok = 1;
- last FAMILY_CHECK;
+ } else {
+ # collect only the binding side
+ push @flr,[ $fam_listen,$lsockaddr ];
}
-
- }
-
- if (! $ok)
- {
- return _error($sock, $EINVAL, "getaddrinfo: $msg");
- }
-
- LOOP_LRES: while(1) {
-
- $family = (exists $arg->{PeerAddr})? ($rres[0]):($lres[0]) ; # One concrete family.
-
- #printf "DEBUG $family \n";
- my $fam_listen;
- ($fam_listen,undef,undef,$lres,undef,@lres) = @lres;
-
- if ($fam_listen != $family)
- {
- next LOOP_LRES;
}
- if ($lres && $family == AF_INET6) {
- if ($arg->{LocalFlow} || $arg->{LocalScope}) {
- my @sa_in6 = unpack_sockaddr_in6_all($lres);
- $sa_in6[1] = $arg->{LocalFlow} || 0;
- $sa_in6[3] = _scope_ntohl($arg->{LocalScope}) || 0;
- $lres = pack_sockaddr_in6_all(@sa_in6);
- }
- }
-
- $sock->socket($family, $type, $proto) or
- return _error($sock, $!, "socket: $!");
+ # try to bind and maybe connect
+ # if multihomed try all combinations until success
+ for my $flr (@flr) {
+ my ($family,$lres,$rres) = @$flr;
+
+ if ( $family == AF_INET6) {
+ if ($arg->{LocalFlow} || $arg->{LocalScope}) {
+ my @sa_in6 = unpack_sockaddr_in6_all($lres);
+ $sa_in6[1] = $arg->{LocalFlow} || 0;
+ $sa_in6[3] = _scope_ntohl($arg->{LocalScope}) || 0;
+ $lres = pack_sockaddr_in6_all(@sa_in6);
+ }
+ }
- if (defined $arg->{Blocking}) {
- defined $sock->blocking($arg->{Blocking}) or
- return _error($sock, $!, "sockopt: $!");
- }
+ $sock->socket($family, $type, $proto) or
+ return _error($sock, $!, "socket: $!");
- if ($arg->{Reuse} || $arg->{ReuseAddr}) {
- $sock->sockopt(SO_REUSEADDR,1) or
- return _error($sock, $!, "sockopt: $!");
- }
+ if (defined $arg->{Blocking}) {
+ defined $sock->blocking($arg->{Blocking}) or
+ return _error($sock, $!, "sockopt: $!");
+ }
- if ($arg->{ReusePort}) {
- $sock->sockopt(SO_REUSEPORT,1) or
- return _error($sock, $!, "sockopt: $!");
- }
+ if ($arg->{Reuse} || $arg->{ReuseAddr}) {
+ $sock->sockopt(SO_REUSEADDR,1) or
+ return _error($sock, $!, "sockopt: $!");
+ }
- if ($arg->{Broadcast}) {
- $sock->sockopt(SO_BROADCAST,1) or
- return _error($sock, $!, "sockopt: $!");
- }
+ if ($arg->{ReusePort}) {
+ $sock->sockopt(SO_REUSEPORT,1) or
+ return _error($sock, $!, "sockopt: $!");
+ }
- if($lres || exists $arg->{Listen}) {
- $sock->bind($lres) or
- return _error($sock, $!, "bind: $!");
- }
+ if ($arg->{Broadcast}) {
+ $sock->sockopt(SO_BROADCAST,1) or
+ return _error($sock, $!, "sockopt: $!");
+ }
- if(exists $arg->{Listen}) {
- $sock->listen($arg->{Listen} || 5) or
- return _error($sock, $!, "listen: $!");
- last;
- }
+ 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);
+ }
- # don't try to connect unless we're given a PeerAddr
- last unless exists($arg->{PeerAddr});
+ if(exists $arg->{Listen}) {
+ $sock->listen($arg->{Listen} || 5) or
+ return _error($sock, $!, "listen: $!");
+ }
- (undef ,undef , undef, $rres,undef , @rres) = @rres;
+ # connect only if PeerAddr and thus $rres is given
+ last if ! $rres;
- if ($rres && $family == AF_INET6) {
- if ($arg->{PeerFlow} || $arg->{PeerScope}) {
- my @sa_in6 = unpack_sockaddr_in6_all($rres);
- $sa_in6[1] = $arg->{PeerFlow} || 0;
- $sa_in6[3] = _scope_ntohl($arg->{PeerScope}) || 0;
- $rres = pack_sockaddr_in6_all(@sa_in6);
- }
- }
-
- last
- unless($type == SOCK_STREAM || defined $rres);
-
-# return _error($sock, $EINVAL, "Bad hostname '",$arg->{PeerAddr},"'")
-# unless (defined $rres);
-
-# my $timeout = ${*$sock}{'io_socket_timeout'};
-# my $before = time() if $timeout;
-
- undef $@;
- if ($sock->connect($rres)) {
-# ${*$sock}{'io_socket_timeout'} = $timeout;
- return $sock;
+ if ( $family == AF_INET6) {
+ if ($arg->{PeerFlow} || $arg->{PeerScope}) {
+ my @sa_in6 = unpack_sockaddr_in6_all($rres);
+ $sa_in6[1] = $arg->{PeerFlow} || 0;
+ $sa_in6[3] = _scope_ntohl($arg->{PeerScope}) || 0;
+ $rres = pack_sockaddr_in6_all(@sa_in6);
+ }
}
+
+ undef $@;
+ last if $sock->connect($rres);
-#
-# GOOD !!!
- return _error($sock, $!, $@ || "Timeout")
- unless ((scalar(@rres)>=5) && ($arg->{MultiHomed}));
-
-# if ($timeout) {
-# my $new_timeout = $timeout - (time() - $before);
-# return _error($sock,
-# (exists(&Errno::ETIMEDOUT) ? Errno::ETIMEDOUT() : $EINVAL),
-# "Timeout") if $new_timeout <= 0;
-# ${*$sock}{'io_socket_timeout'} = $new_timeout;
-# }
-
+ return _error($sock, $!, $@ || "Timeout")
+ if ! $arg->{MultiHomed};
+
}
- $sock;
+ return $sock;
}
sub _scope_ntohl($)
@@ -383,7 +334,7 @@
@_ == 1 or croak 'usage: $sock->sockhost()';
my ($sock) = @_;
return undef unless (my $addr = $sock->sockaddr);
- inet_ntop($sock->sockdomain, $addr);
+ Socket6::inet_ntop($sock->sockdomain, $addr);
}
sub sockflow
@@ -420,7 +371,7 @@
@_ == 1 or croak 'usage: $sock->peerhost()';
my ($sock) = @_;
return undef unless (my $addr = $sock->peeraddr);
- inet_ntop($sock->sockdomain, $addr);
+ Socket6::inet_ntop($sock->sockdomain, $addr);
}
sub peerflow
@@ -561,7 +512,7 @@
$sock = IO::Socket::INET6->new('[::1]:25');
$sock = IO::Socket::INET6->new(PeerPort => 9999,
- PeerAddr => inet_ntop(AF_INET6,in6addr_broadcast),
+ PeerAddr => Socket6::inet_ntop(AF_INET6,in6addr_broadcast),
Proto => udp,
LocalAddr => 'localhost',
Broadcast => 1 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/IO-Socket-INET6-2.57/t/listen_port_only.t new/IO-Socket-INET6-2.61/t/listen_port_only.t
--- old/IO-Socket-INET6-2.57/t/listen_port_only.t 1970-01-01 01:00:00.000000000 +0100
+++ new/IO-Socket-INET6-2.61/t/listen_port_only.t 2010-03-25 09:45:16.000000000 +0100
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use IO::Socket::INET6;
+
+use Test::More;
+
+my ($server,$port);
+# try to create inet6 listener on some port, w/o given
+# LocalHost (should use :: then)
+CREATE_SERVER:
+for my $i (1 .. 100)
+{
+ $port = int(rand(50000)+2000);
+ $server = IO::Socket::INET6->new(
+ LocalPort => $port,
+ Listen => 10,
+ );
+ if ($server)
+ {
+ last CREATE_SERVER;
+ }
+}
+
+if (!$server)
+{
+ plan skip_all => "failed to create inet6 listener";
+}
+elsif ( $server->sockhost ne '::' )
+{
+ plan skip_all => "not listening on ::, maybe inet6 not available";
+}
+else
+{
+ plan tests => 1;
+
+ my $client = IO::Socket::INET6->new( "[::1]:$port" );
+
+ # TEST
+ ok($client, "Client was initialised - connected.");
+}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org