daemon: create_reusable_socket: listen on IPv6 and IPv4

When the 'Domain' configuration of IO::Socket::IP is set to PF_INET6,
it will prefer IPv6, but since we don't set 'V6Only' it will also
listen on IPv4 interfaces[0].

Drop the now obsoleted '$family' parameter.

[0]: https://perldoc.perl.org/IO::Socket::IP#REPLACING-IO::Socket-DEFAULT-BEHAVIOUR

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Oguz Bektas 2021-03-24 14:20:36 +01:00 committed by Thomas Lamprecht
parent b15abdfe2e
commit 390fc10dc4

View File

@ -799,7 +799,7 @@ sub register_status_command {
# some useful helper
sub create_reusable_socket {
my ($self, $port, $host, $family) = @_;
my ($self, $port, $host) = @_;
die "no port specifed" if !$port;
@ -820,10 +820,10 @@ sub create_reusable_socket {
} else {
$socket = IO::Socket::IP->new(
LocalAddr => $host,
Domain => PF_INET6,
LocalHost => $host,
LocalPort => $port,
Listen => SOMAXCONN,
Family => $family,
Proto => 'tcp',
GetAddrInfoFlags => 0,
ReuseAddr => 1) ||