From: Sebastian Harl Date: Sun, 24 Feb 2008 17:25:14 +0000 (+0100) Subject: ping plugin: Fixed a typo when setting the TTL. X-Git-Tag: collectd-4.2.5~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f91cd5dc6d1deefb404f346e5b3d167865428f76;p=collectd.git ping plugin: Fixed a typo when setting the TTL. 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 Signed-off-by: Florian Forster --- diff --git a/src/ping.c b/src/ping.c index 05f660b3..2f7c064d 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);