From 3c2c1643171d86c5e6463905c353922bc15f2097 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 19 Jul 2004 05:23:56 +0000 Subject: make the tcp ping actually work --- perl-install/network/tools.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'perl-install') diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 1be0037c9..e360f5ab4 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -131,7 +131,15 @@ sub test_connected { sub check_link_beat() { bg_command->new(sub { require Net::Ping; - print Net::Ping->new($> ? "tcp" : "icmp")->ping("mandrakesoft.com") ? 1 : 0; + my $p; + if ($>) { + $p = Net::Ping->new("tcp"); + # Try connecting to the www port instead of the echo port + $p->{port_num} = getservbyname("http", "tcp"); + } else { + $p = Net::Ping->new("icmp"); + } + print $p->ping("www.mandrakesoft.com") ? 1 : 0; }); } -- cgit v1.2.1