[pve-devel] [RFC 2/2 manager] proxy: allow setting BIND_IP for pveproxy

Oguz Bektas o.bektas at proxmox.com
Mon Feb 15 11:00:23 CET 2021


hi,

thanks for responding!

On Wed, Feb 10, 2021 at 05:20:59PM +0100, Stoiko Ivanov wrote:
> 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

after looking at it more it looks like `undef` might be better indeed.

> 
> did you test it in a few different scenarios? - e.g.:
> * ipv6 only host
> * dual-stacked host
> * host with multiple interfaces and IPs

no, i've only tested ipv4 -- i'll take a look at these too

> 
> > +    my $socket = $self->create_reusable_socket(8006, $bind_ip, $family);
> >  
> >      my $dirs = {};
> >  
> 




More information about the pve-devel mailing list