From http://bugs.debian.org/502518 Author: Petr Salinger --- a/t/local/06_tcpecho.t +++ b/t/local/06_tcpecho.t @@ -15,7 +15,7 @@ my $msg = 'ssleay-tcp-test'; { my $ip = "\x7F\0\0\x01"; - my $serv_params = pack('S n a4 x8', AF_INET, $port, $ip); + my $serv_params = sockaddr_in($port, $ip); $sock = gensym(); socket($sock, AF_INET, SOCK_STREAM, 0) or die; bind($sock, $serv_params) or die; --- a/t/local/07_sslecho.t +++ b/t/local/07_sslecho.t @@ -13,7 +13,7 @@ my $pid; my $port = 1212; my $dest_ip = gethostbyname('localhost'); -my $dest_serv_params = pack ('S n a4 x8', AF_INET, $port, $dest_ip); +my $dest_serv_params = sockaddr_in($port, $dest_ip); my $msg = 'ssleay-test'; my $cert_pem = File::Spec->catfile('t', 'data', 'cert.pem'); @@ -31,7 +31,7 @@ Net::SSLeay::library_init(); { my $ip = "\x7F\0\0\x01"; - my $serv_params = pack ('S n a4 x8', AF_INET, $port, $ip); + my $serv_params = sockaddr_in($port, $ip); $sock = gensym(); socket($sock, AF_INET, SOCK_STREAM, 0) or BAIL_OUT("failed to open socket: $!"); bind($sock, $serv_params) or BAIL_OUT("failed to bind socket: $!");