From: Wolfgang Bumiller Date: Wed, 27 May 2015 11:16:34 +0000 (+0200) Subject: prevent the use of AI_ADDRCONFIG X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=e43b3a0f5085d1fccd5dc3e82d5030613fbd644a;hp=7d97ec60e8bf5fffe769aab514142566a2651b7b 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. --- diff --git a/src/PVE/Daemon.pm b/src/PVE/Daemon.pm index ddbe656..8a90020 100644 --- a/src/PVE/Daemon.pm +++ b/src/PVE/Daemon.pm @@ -807,6 +807,7 @@ sub create_reusable_socket { Listen => SOMAXCONN, Family => $family, Proto => 'tcp', + GetAddrInfoFlags => 0, ReuseAddr => 1) || die "unable to create socket - $@\n"; diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 01823c2..1bc9eec 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -696,7 +696,8 @@ sub next_unused_port { LocalPort => $p, ReuseAddr => 1, Family => $family, - Proto => 0); + Proto => 0, + GetAddrInfoFlags => 0); if ($sock) { close($sock);