]> git.proxmox.com Git - pve-common.git/commitdiff
Fix next_unused_port already bin detection
authorStefan Priebe <s.priebe@profihost.ag>
Mon, 2 Feb 2015 08:40:54 +0000 (09:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 11 Feb 2015 05:35:37 +0000 (06:35 +0100)
unsecure migration does not use localhost to bind to. Instead it uses a specific IP on the node.
As we don't know that IP in this part of the code the only chance to check for a possible already
existing bind is to bind to all IPs.

Signed-off-by: Stefan Priebe <s.priebe@profihost.ag>
data/PVE/Tools.pm

index b222debf24ebdd2ee81808e0ecf5ed43a15e7edb..b666e9b8e915e7e08c4edbdac63593e071ae5a00 100644 (file)
@@ -692,7 +692,7 @@ sub next_unused_port {
            next if $ports->{$p}; # reserved
 
            my $sock = IO::Socket::INET->new(Listen => 5,
            next if $ports->{$p}; # reserved
 
            my $sock = IO::Socket::INET->new(Listen => 5,
-                                            LocalAddr => 'localhost',
+                                            LocalAddr => '0.0.0.0',
                                             LocalPort => $p,
                                             ReuseAddr => 1,
                                             Proto     => 0);
                                             LocalPort => $p,
                                             ReuseAddr => 1,
                                             Proto     => 0);