prevent the use of AI_ADDRCONFIG

perl's IO::Socket::IP passes AI_ADDRCONFIG if no GetAddrInfoFlags are passed,
which is often useful but also causes it to error when explicitly trying to
bind to 127.0.0.1 when there are no _other_ IPv4 addresses present.
This commit is contained in:
Wolfgang Bumiller 2015-05-27 13:16:34 +02:00 committed by Dietmar Maurer
parent 7d97ec60e8
commit e43b3a0f50
2 changed files with 3 additions and 1 deletions

View File

@ -807,6 +807,7 @@ sub create_reusable_socket {
Listen => SOMAXCONN,
Family => $family,
Proto => 'tcp',
GetAddrInfoFlags => 0,
ReuseAddr => 1) ||
die "unable to create socket - $@\n";

View File

@ -696,7 +696,8 @@ sub next_unused_port {
LocalPort => $p,
ReuseAddr => 1,
Family => $family,
Proto => 0);
Proto => 0,
GetAddrInfoFlags => 0);
if ($sock) {
close($sock);