From dbfa03c93de4d047f60461bac9aee6c2890f271e Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 13 May 2011 08:29:05 -0700 Subject: [PATCH] Handle case where local socket is IPv4 and remote is v6 --- miniserv.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/miniserv.pl b/miniserv.pl index 98c7affd2..3c909c339 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -430,8 +430,9 @@ if ($config{'inetd'}) { $acptaddr || exit; # Work out remote and local IPs - (undef, $peera, undef) = &get_address_ip($acptaddr, $ipv6); + $ipv6 = length($acptaddr) > 16; (undef, $locala) = &get_socket_ip(SOCK, $ipv6); + (undef, $peera, undef) = &get_address_ip($acptaddr, $ipv6); print DEBUG "main: Starting handle_request loop pid=$$\n"; while(&handle_request($peera, $locala, $ipv6)) { }