]> git.proxmox.com Git - pve-common.git/commitdiff
prevent the use of AI_ADDRCONFIG
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 27 May 2015 11:16:34 +0000 (13:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 27 May 2015 13:32:08 +0000 (15:32 +0200)
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.

src/PVE/Daemon.pm
src/PVE/Tools.pm

index ddbe65626968bffd5deda7122206a576fcbd9d26..8a90020bfed1f1f7024dc66af215de9130267c7b 100644 (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";
 
index 01823c28fd1cbaa1ea5ad394215b75b31007f808..1bc9eec6afa857926e62626747318268f4d21ed6 100644 (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);