[pve-devel] [PATCH] pass port family to next_vnc_port

Wolfgang Bumiller w.bumiller at proxmox.com
Mon May 11 16:28:27 CEST 2015


---
 PVE/API2/Nodes.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 1191925..e124026 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -680,14 +680,16 @@ __PACKAGE__->register_method ({
 	$sslcert = PVE::Tools::file_get_contents("/etc/pve/pve-root-ca.pem", 8192)
 	    if !$sslcert;
 
-	my $port = PVE::Tools::next_vnc_port();
-
-	my $remip;
+	my ($remip, $family);
 
 	if ($node ne PVE::INotify::nodename()) {
-	    $remip = PVE::Cluster::remote_node_ip($node);
+	    ($remip, $family) = PVE::Cluster::remote_node_ip_and_family($node);
+	} else {
+	    $family = PVE::Tools::get_host_address_family($node);
 	}
 
+	my $port = PVE::Tools::next_vnc_port(Family => $family);
+
 	# NOTE: vncterm VNC traffic is already TLS encrypted,
 	# so we select the fastest chipher here (or 'none'?)
 	my $remcmd = $remip ? 
-- 
2.1.4





More information about the pve-devel mailing list