From 391daa1e2f2ee79d61bbfd4f8b4c8c7bcf740053 Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Tue, 11 Apr 2017 09:32:30 +0000 Subject: [PATCH] TcpServerUtils.pm: use ::1 for non-global IPV6 (Forum #62203) git-svn-id: https://svn.fhem.de/fhem/trunk@13967 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/TcpServerUtils.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/TcpServerUtils.pm b/fhem/FHEM/TcpServerUtils.pm index d97a47f4a..6e221911b 100644 --- a/fhem/FHEM/TcpServerUtils.pm +++ b/fhem/FHEM/TcpServerUtils.pm @@ -24,9 +24,11 @@ TcpServer_Open($$$) } } + my $lh = ($global ? ($global eq "global"? undef : $global) : + ($hash->{IPV6} ? "::1" : "127.0.0.1")); my @opts = ( Domain => ($hash->{IPV6} ? AF_INET6() : AF_UNSPEC), # Linux bug - LocalHost => ($global ? ($global eq "global"? undef:$global) : "127.0.0.1"), + LocalHost => $lh, LocalPort => $port, Listen => 10, Blocking => ($^O =~ /Win/ ? 1 : 0), # Needed for .WRITEBUFFER@darwin