]> git.proxmox.com Git - pve-common.git/commit - src/PVE/Daemon.pm
daemon: explicitly bind to wildcard address.
authorStoiko Ivanov <s.ivanov@proxmox.com>
Wed, 5 May 2021 14:36:23 +0000 (16:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 7 May 2021 14:19:09 +0000 (16:19 +0200)
commit2f8be3bfda203065b22e60862e5f98d831a46921
tree3fcce0ef02276f4525d8d43273989fc5e71cb2e2
parent9449731c606b5dfff6b35fa93f9e3a741c5a8c93
daemon: explicitly bind to wildcard address.

with the recent change in pve-manager pveproxy (and spiceproxy)
try binding to '::' per default. This fails for hosts having disabled
ipv6 via kernel commandline.

Our desired behavior of binding on '::' and only falling back to
'0.0.0.0' in case this is not supported is not directly possible with
IO::Socket::IP->new (or rather by Socket::GetAddrInfo, which at least
on my system always returns the v4 wildcard-address first).

the code now binds to:
* the provided $host if not undef
* '::' if $host is not set
* '0.0.0.0' if $host is not set and binding on '::' yields undef,
  which means that it failed to create a socket which normally means
  that IPv6 is disabled

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Daemon.pm