From e224b7d2e6a729b48e9669e200fd7aeb1e9b5702 Mon Sep 17 00:00:00 2001 From: Oguz Bektas Date: Mon, 22 Mar 2021 15:00:44 +0100 Subject: [PATCH] fix #417: proxy: allow settnig LISTEN_IP for pveproxy and spiceproxy The $host variable is set to "::0" by default to listen on wildcard (with 'Domain' => PF_INET6). If 'LISTEN_IP' is defined in /etc/default/pveproxy, that IP will be used instead. Signed-off-by: Oguz Bektas --- PVE/Service/pveproxy.pm | 4 ++-- PVE/Service/spiceproxy.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm index 571a6bf5..4ecd442a 100755 --- a/PVE/Service/pveproxy.pm +++ b/PVE/Service/pveproxy.pm @@ -69,8 +69,8 @@ sub init { my $lockfh = IO::File->new(">>${accept_lock_fn}") || die "unable to open lock file '${accept_lock_fn}' - $!\n"; - my $family = PVE::Tools::get_host_address_family($self->{nodename}); - my $socket = $self->create_reusable_socket(8006, undef, $family); + my $listen_ip = $proxyconf->{LISTEN_IP} // "::0"; + my $socket = $self->create_reusable_socket(8006, $listen_ip); my $dirs = {}; diff --git a/PVE/Service/spiceproxy.pm b/PVE/Service/spiceproxy.pm index f8e06b60..24be0ed7 100755 --- a/PVE/Service/spiceproxy.pm +++ b/PVE/Service/spiceproxy.pm @@ -39,8 +39,8 @@ sub init { my $lockfh = IO::File->new(">>${accept_lock_fn}") || die "unable to open lock file '${accept_lock_fn}' - $!\n"; - my $family = PVE::Tools::get_host_address_family($self->{nodename}); - my $socket = $self->create_reusable_socket(3128, undef, $family); + my $listen_ip = $proxyconf->{LISTEN_IP} // "::0"; + my $socket = $self->create_reusable_socket(3128, $listen_ip); $self->{server_config} = { keep_alive => 0,