[pve-devel] [PATCH 1/2] Fix next_unused_port already bin detection

Stefan Priebe s.priebe at profihost.ag
Mon Feb 2 09:40:54 CET 2015


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 at profihost.ag>
---
 data/PVE/Tools.pm |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm
index 05576e0..1049864 100644
--- a/data/PVE/Tools.pm
+++ b/data/PVE/Tools.pm
@@ -693,7 +693,7 @@ sub next_unused_port {
 	    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);
-- 
1.7.10.4




More information about the pve-devel mailing list