summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/tools.pm10
1 files changed, 9 insertions, 1 deletions
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;
});
}