From 7c8d7757ff713d74fa0bb44b81cbbd29f87c802d Mon Sep 17 00:00:00 2001
From: slerena <slerena@gmail.com>
Date: Tue, 5 Jun 2007 18:37:13 +0000
Subject: [PATCH] 2007-06-05  Sancho Lerena <slerena@gmail.com>

        * pandora_network.pm: Small bug that causes some hosts to do not reply
        at ICMP request with a small payload (1 byte). Now uses by default
        32 bytes per reply. Also modified icmp_data for latency checks because
        was not using global timeout and has the same problems with small
        payloads.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@487 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_server/ChangeLog              | 4 +++-
 pandora_server/bin/pandora_network.pl | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog
index 0c5e43b4ef..1c5c93b511 100644
--- a/pandora_server/ChangeLog
+++ b/pandora_server/ChangeLog
@@ -2,7 +2,9 @@
 
 	* pandora_network.pm: Small bug that causes some hosts to do not reply
 	at ICMP request with a small payload (1 byte). Now uses by default 
-	32 bytes per reply.
+	32 bytes per reply. Also modified icmp_data for latency checks because 
+	was not using global timeout and has the same problems with small
+	payloads.
 
 2007-06-04  Raúl Mateos  <rmateos@netscape.net>
 
diff --git a/pandora_server/bin/pandora_network.pl b/pandora_server/bin/pandora_network.pl
index bfa5965f5d..9a9df15040 100755
--- a/pandora_server/bin/pandora_network.pl
+++ b/pandora_server/bin/pandora_network.pl
@@ -333,7 +333,7 @@ sub pandora_ping_icmp {
 	if (!defined($dest)) {
 		return 0;
 	}
-	// Some hosts don't accept ICMP with too small payload. Use 32Bytes	
+	# Some hosts don't accept ICMP with too small payload. Use 32Bytes	
 	$p = Net::Ping->new("icmp",$l_timeout,32);
 	$result = $p->ping($dest);
 	
@@ -536,7 +536,7 @@ sub exec_network_module {
 	} elsif ($id_tipo_modulo == 7){ # ICMP (data for latency in ms)
 		# This module only could be executed if executed as root
 		if ($> == 0){
-			my $nm = Net::Ping->new("icmp");
+			my $nm = Net::Ping->new("icmp", $pa_config->{'networktimeout'}, 32);
 			my $icmp_return;
 			my $icmp_reply;
 			my $icmp_ip;