diff options
author | Olivier Blin <oblin@mandriva.org> | 2004-07-19 05:23:56 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2004-07-19 05:23:56 +0000 |
commit | 3c2c1643171d86c5e6463905c353922bc15f2097 (patch) | |
tree | 88f0057287f1497ce8a014626561225fcdd029f1 | |
parent | cd52931e8fd0cc2fd81cea811989604dd7e4770e (diff) | |
download | drakx-backup-do-not-use-3c2c1643171d86c5e6463905c353922bc15f2097.tar drakx-backup-do-not-use-3c2c1643171d86c5e6463905c353922bc15f2097.tar.gz drakx-backup-do-not-use-3c2c1643171d86c5e6463905c353922bc15f2097.tar.bz2 drakx-backup-do-not-use-3c2c1643171d86c5e6463905c353922bc15f2097.tar.xz drakx-backup-do-not-use-3c2c1643171d86c5e6463905c353922bc15f2097.zip |
make the tcp ping actually work
-rw-r--r-- | perl-install/network/tools.pm | 10 |
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; }); } |