<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1528" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've finally got around fixing a problem I had with
the ping plugin.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This patch sets the icmp_seq value to something
(and clearing everything else, just for the sake of it). I found that some of my
ping hosts (namely my ISP:s gateway and DNS server) wouldn't reply if icmp_seq
was 0.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>It was okay for the first host, but since nothing
sets icmp_seq in the original code, a zero happened to be on the stack during
the next iterations in the ping plugin. As a result, the graphs showed
NaN.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>diff -Nru collectd-3.7.0-orig/src/libping/ping.c
collectd-3.7.0/src/libping/ping.c<BR>---
collectd-3.7.0-orig/src/libping/ping.c 2006-01-30 22:59:21.000000000
+0100<BR>+++ collectd-3.7.0/src/libping/ping.c 2006-01-31
14:10:45.000000000 +0100<BR>@@ -172,11 +172,13 @@<BR>
return -2;<BR> }<BR> <BR>+ memset(buf, 0,
sizeof(buf));<BR> icp = (struct icmp *)buf;<BR>
icp->icmp_type = ICMP_ECHO;<BR> icp->icmp_code =
0;<BR> icp->icmp_cksum = 0;<BR>
icp->icmp_id = getpid() & 0xFFFF;<BR>+
icp->icmp_seq = icp->icmp_id;<BR>
icp->icmp_cksum = in_checksum((u_short *)icp, len
);<BR> <BR> if(( ss = sendto( datum->sock, buf, sizeof( buf
), 0, <BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>/Tommie</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT></BODY></HTML>