summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-07-19 05:23:56 +0000
committerOlivier Blin <oblin@mandriva.org>2004-07-19 05:23:56 +0000
commit3c2c1643171d86c5e6463905c353922bc15f2097 (patch)
tree88f0057287f1497ce8a014626561225fcdd029f1 /perl-install/network
parentcd52931e8fd0cc2fd81cea811989604dd7e4770e (diff)
downloaddrakx-3c2c1643171d86c5e6463905c353922bc15f2097.tar
drakx-3c2c1643171d86c5e6463905c353922bc15f2097.tar.gz
drakx-3c2c1643171d86c5e6463905c353922bc15f2097.tar.bz2
drakx-3c2c1643171d86c5e6463905c353922bc15f2097.tar.xz
drakx-3c2c1643171d86c5e6463905c353922bc15f2097.zip
make the tcp ping actually work
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;
});
}