[pve-devel] [RFC 2/2 manager] proxy: allow setting BIND_IP for pveproxy
Stoiko Ivanov
s.ivanov at proxmox.com
Wed Feb 10 17:20:59 CET 2021
Thanks for looking into this!
On Wed, 10 Feb 2021 17:01:42 +0100
Oguz Bektas <o.bektas at proxmox.com> wrote:
> default to 0.0.0.0 to preserve backwards behavior
>
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
> PVE/Service/pveproxy.pm | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/PVE/Service/pveproxy.pm b/PVE/Service/pveproxy.pm
> index 571a6bf5..ce1d42a6 100755
> --- a/PVE/Service/pveproxy.pm
> +++ b/PVE/Service/pveproxy.pm
> @@ -70,7 +70,8 @@ sub init {
> 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 $bind_ip = $proxyconf->{BIND_IP} // '0.0.0.0'; # default
any reason why the '0.0.0.0' is necessary? (the socket got created with
undef before after all) - Given that I find the inner workings of perl
IO::Socket::IP (which gets passed the arguments in create_reusable_socket
eventually) a bit surprising in certain situations I think leaving it as
it was might have its merit
did you test it in a few different scenarios? - e.g.:
* ipv6 only host
* dual-stacked host
* host with multiple interfaces and IPs
> + my $socket = $self->create_reusable_socket(8006, $bind_ip, $family);
>
> my $dirs = {};
>
More information about the pve-devel
mailing list