Commit 0f5bc844 authored by Wolfgang Bumiller's avatar Wolfgang Bumiller Committed by Dietmar Maurer

pass port family to next_vnc_port

parent cbfe220a
...@@ -680,14 +680,16 @@ __PACKAGE__->register_method ({ ...@@ -680,14 +680,16 @@ __PACKAGE__->register_method ({
$sslcert = PVE::Tools::file_get_contents("/etc/pve/pve-root-ca.pem", 8192) $sslcert = PVE::Tools::file_get_contents("/etc/pve/pve-root-ca.pem", 8192)
if !$sslcert; if !$sslcert;
my $port = PVE::Tools::next_vnc_port(); my ($remip, $family);
my $remip;
if ($node ne PVE::INotify::nodename()) { if ($node ne PVE::INotify::nodename()) {
$remip = PVE::Cluster::remote_node_ip($node); ($remip, $family) = PVE::Cluster::remote_node_ip($node);
} else {
$family = PVE::Tools::get_host_address_family($node);
} }
my $port = PVE::Tools::next_vnc_port($family);
# NOTE: vncterm VNC traffic is already TLS encrypted, # NOTE: vncterm VNC traffic is already TLS encrypted,
# so we select the fastest chipher here (or 'none'?) # so we select the fastest chipher here (or 'none'?)
my $remcmd = $remip ? my $remcmd = $remip ?
......
...@@ -5,6 +5,7 @@ use warnings; ...@@ -5,6 +5,7 @@ use warnings;
use Net::IP; use Net::IP;
use PVE::Tools; use PVE::Tools;
use PVE::INotify;
use Digest::MD5 qw(md5_hex); use Digest::MD5 qw(md5_hex);
use URI; use URI;
use URI::Escape; use URI::Escape;
...@@ -143,7 +144,9 @@ sub run_spiceterm { ...@@ -143,7 +144,9 @@ sub run_spiceterm {
my $authuser = $rpcenv->get_user(); my $authuser = $rpcenv->get_user();
my $port = PVE::Tools::next_spice_port(); my $nodename = PVE::INotify::nodename();
my $family = PVE::Tools::get_host_address_family($nodename);
my $port = PVE::Tools::next_spice_port($family);
my ($ticket, undef, $remote_viewer_config) = my ($ticket, undef, $remote_viewer_config) =
PVE::AccessControl::remote_viewer_config($authuser, $vmid, $node, $proxy, $title, $port); PVE::AccessControl::remote_viewer_config($authuser, $vmid, $node, $proxy, $title, $port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment