Hi Julien

First of all I'm not the maintainer and I'm not having that good IPv6
knowledge. Could you try if the patch inbetween the upstreams versions
2.55 and 2.56 solves the problem? The debdiff for a proposed NMU is
attached.

Could you try for that the package at [1]?

 [1] 
http://people.debian.org/~carnil/tmp/libio-socket-inet6-perl_2.54-1.2_all.deb

Bests
Salvatore
diff -u libio-socket-inet6-perl-2.54/lib/IO/Socket/INET6.pm libio-socket-inet6-perl-2.54/lib/IO/Socket/INET6.pm
--- libio-socket-inet6-perl-2.54/lib/IO/Socket/INET6.pm
+++ libio-socket-inet6-perl-2.54/lib/IO/Socket/INET6.pm
@@ -148,12 +148,6 @@
     $proto ||= (getprotobyname('tcp'))[2];
     $type = $arg->{Type} || $socket_type{(getprotobynumber($proto))[0]};
 
-    my @lres = ();
-    @lres = getaddrinfo($laddr,$lport,$family,$type,$proto,AI_PASSIVE);
-
-    return _error($sock, $EINVAL, "getaddrinfo: $lres[0]")
-	unless(scalar(@lres)>=5);
-
     $arg->{PeerAddr} = $arg->{PeerHost}
 	if exists $arg->{PeerHost} && !exists $arg->{PeerAddr};
 
@@ -165,12 +159,60 @@
 
     $sock->blocking($arg->{Blocking}) if defined $arg->{Blocking};
 
-    
-    my @rres = ();
-    if (defined $raddr) {
-    @rres = getaddrinfo($raddr,$rport,$family,$type,$proto,AI_PASSIVE);
-    return _error($sock, $EINVAL, "getaddrinfo: $rres[0]")
-	    unless (scalar(@rres)>=5);
+    # 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);
+    }
+
+    my $ok = 0;
+    my $msg;
+
+    my @lres;
+    my @rres;
+
+    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;
+            }
+            else {
+                $msg = $rres[0];
+            }
+        }
+        else {
+            $ok = 1;
+            last FAMILY_CHECK;
+        }
+
+    }
+
+    if (! $ok)
+    {
+        return _error($sock, $EINVAL, "getaddrinfo: $msg");
     }
 
     while(1) {
diff -u libio-socket-inet6-perl-2.54/debian/changelog libio-socket-inet6-perl-2.54/debian/changelog
--- libio-socket-inet6-perl-2.54/debian/changelog
+++ libio-socket-inet6-perl-2.54/debian/changelog
@@ -1,3 +1,12 @@
+libio-socket-inet6-perl (2.54-1.2) testing-proposed-updates; urgency=low
+
+  * Non-maintainer upload.
+  * Assure that both side of the connection have the same family. Previously
+    IO::Socket::Inet6 tried to bind even when one side is AF_INET and the
+    other AF_INET6 (Closes: #608413).
+
+ -- Salvatore Bonaccorso <car...@debian.org>  Wed, 05 Jan 2011 10:10:02 +0100
+
 libio-socket-inet6-perl (2.54-1.1) unstable; urgency=low
 
   * Non-maintainer upload.

Attachment: signature.asc
Description: Digital signature

Reply via email to