changed debian/source/format to native
This commit is contained in:
parent
92aa29b8c9
commit
0a0efd52ff
|
@ -1,91 +0,0 @@
|
|||
Subject: [PATCH] Disable getaddrinfo(3) AI_ADDRCONFIG for localhost and IPv4
|
||||
numeric addresses
|
||||
|
||||
AI_ADDRCONFIG can be a bad default for systems with a dual protocol
|
||||
loopback device but just IPv6 connectivity. In such a case,
|
||||
getaddrinfo(3) on 127.0.0.1 or 0.0.0.0 will fail with EAI_ADDRFAMILY
|
||||
even though the loopback device is able to handle them.
|
||||
|
||||
Origin: vendor
|
||||
Bug: https://rt.cpan.org/Public/Bug/Display.html?id=132760
|
||||
Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=132760
|
||||
From: Niko Tyni <ntyni@debian.org>
|
||||
Reviewed-by: gregor herrmann <gregoa@debian.org>
|
||||
Last-Update: 2023-10-29
|
||||
|
||||
---
|
||||
lib/IO/Socket/IP.pm | 24 +++++++++++++++++++++---
|
||||
1 file changed, 21 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/lib/IO/Socket/IP.pm
|
||||
+++ b/lib/IO/Socket/IP.pm
|
||||
@@ -26,6 +26,7 @@
|
||||
);
|
||||
my $AF_INET6 = eval { Socket::AF_INET6() }; # may not be defined
|
||||
my $AI_ADDRCONFIG = eval { Socket::AI_ADDRCONFIG() } || 0;
|
||||
+my $AI_NUMERICHOST = eval { Socket::AI_NUMERICHOST() } || 0;
|
||||
use POSIX qw( dup2 );
|
||||
use Errno qw( EINVAL EINPROGRESS EISCONN ENOTCONN ETIMEDOUT EWOULDBLOCK EOPNOTSUPP );
|
||||
|
||||
@@ -414,6 +415,8 @@
|
||||
my ( $arg ) = @_;
|
||||
|
||||
my %hints;
|
||||
+ my $localflags;
|
||||
+ my $peerflags;
|
||||
my @localinfos;
|
||||
my @peerinfos;
|
||||
|
||||
@@ -425,9 +428,20 @@
|
||||
|
||||
if( defined $arg->{GetAddrInfoFlags} ) {
|
||||
$hints{flags} = $arg->{GetAddrInfoFlags};
|
||||
+ $localflags = $arg->{GetAddrInfoFlags};
|
||||
+ $peerflags = $arg->{GetAddrInfoFlags};
|
||||
}
|
||||
else {
|
||||
- $hints{flags} = $AI_ADDRCONFIG;
|
||||
+ if (defined $arg->{LocalHost} and $arg->{LocalHost} =~ /^\d+\.\d+\.\d+\.\d+$/) {
|
||||
+ $localflags = $AI_NUMERICHOST;
|
||||
+ } else {
|
||||
+ $localflags = $AI_ADDRCONFIG;
|
||||
+ }
|
||||
+ if (defined $arg->{PeerHost} and $arg->{PeerHost} =~ /^\d+\.\d+\.\d+\.\d+$/) {
|
||||
+ $peerflags = $AI_NUMERICHOST;
|
||||
+ } elsif (defined $arg->{PeerHost} and $arg->{PeerHost} ne 'localhost') {
|
||||
+ $peerflags = $AI_ADDRCONFIG;
|
||||
+ }
|
||||
}
|
||||
|
||||
if( defined( my $family = $arg->{Family} ) ) {
|
||||
@@ -484,6 +498,7 @@
|
||||
my $fallback_port = $1;
|
||||
|
||||
my %localhints = %hints;
|
||||
+ $localhints{flags} = $localflags;
|
||||
$localhints{flags} |= AI_PASSIVE;
|
||||
( my $err, @localinfos ) = getaddrinfo( $host, $service, \%localhints );
|
||||
|
||||
@@ -512,10 +527,12 @@
|
||||
defined $service and $service =~ s/\((\d+)\)$// and
|
||||
my $fallback_port = $1;
|
||||
|
||||
- ( my $err, @peerinfos ) = getaddrinfo( $host, $service, \%hints );
|
||||
+ my %peerhints = %hints;
|
||||
+ $peerhints{flags} = $peerflags;
|
||||
+ ( my $err, @peerinfos ) = getaddrinfo( $host, $service, \%peerhints );
|
||||
|
||||
if( $err and defined $fallback_port ) {
|
||||
- ( $err, @peerinfos ) = getaddrinfo( $host, $fallback_port, \%hints );
|
||||
+ ( $err, @peerinfos ) = getaddrinfo( $host, $fallback_port, \%peerhints );
|
||||
}
|
||||
|
||||
if( $err ) {
|
||||
@@ -595,6 +612,7 @@
|
||||
# If there wasn't, use getaddrinfo()'s AI_ADDRCONFIG side-effect to guess a
|
||||
# suitable family first.
|
||||
else {
|
||||
+ $hints{flags} |= $AI_ADDRCONFIG;
|
||||
( my $err, @infos ) = getaddrinfo( "", "0", \%hints );
|
||||
if( $err ) {
|
||||
$IO::Socket::errstr = $@ = "$err";
|
|
@ -1,2 +0,0 @@
|
|||
skip-internet-test
|
||||
0001-Disable-getaddrinfo-3-AI_ADDRCONFIG-for-localhost-an.patch
|
|
@ -1,23 +0,0 @@
|
|||
Subject: Skip internet test
|
||||
Origin: vendor
|
||||
Forwarded: not-needed
|
||||
From: Dominique Dumont <dod@debian.org>
|
||||
Reviewed-by: gregor herrmann <gregoa@debian.org>
|
||||
Last-Update: 2023-10-29
|
||||
|
||||
skip test that connects to internet
|
||||
---
|
||||
t/31nonblocking-connect-internet.t | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/t/31nonblocking-connect-internet.t
|
||||
+++ b/t/31nonblocking-connect-internet.t
|
||||
@@ -3,7 +3,7 @@
|
||||
use v5.14;
|
||||
use warnings;
|
||||
|
||||
-use Test::More;
|
||||
+use Test::More skip_all => 'cannot connect to internet with Debian build systems';
|
||||
|
||||
use IO::Socket::IP;
|
||||
|
|
@ -1 +1 @@
|
|||
3.0 (quilt)
|
||||
3.0 (native)
|
||||
|
|
Loading…
Reference in New Issue