[collectd] [PATCH] ping plugin: Fixed a typo when setting the TTL.

Sebastian Harl sh at tokkee.org
Sun Feb 24 18:25:14 CET 2008


PING_DEF_TIMEOUT used to be used instead of PING_OPT_TTL as option
argument of ping_setopt(). This caused really strange effects when pinging
hosts, like a failed assertion in ping_timeval_sub() in liboping
indicating a latency <= 0.

Thanks to Romain Francoise for pointing this out and a lot of helpful
debugging information.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/ping.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/ping.c b/src/ping.c
index 05f660b..2f7c064 100644
--- a/src/ping.c
+++ b/src/ping.c
@@ -162,7 +162,7 @@ static int ping_config (const char *key, const char *value)
 	else if (strcasecmp (key, "ttl") == 0)
 	{
 		int ttl = atoi (value);
-		if (ping_setopt (pingobj, PING_DEF_TIMEOUT, (void *) &ttl))
+		if (ping_setopt (pingobj, PING_OPT_TTL, (void *) &ttl))
 		{
 			WARNING ("ping: liboping did not accept the TTL value %i", ttl);
 			return (1);
-- 
1.5.4.2.123.gcf5c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080224/3b81d48a/attachment.pgp 


More information about the collectd mailing list