Sophie

Sophie

distrib > Mageia > 3 > i586 > media > core-release-src > by-pkgid > 28ccc682c7066d5449752cb460502be8 > files > 18

iputils-20121221-2.mga3.src.rpm

diff -Naur iputils-s20100214//arping.c iputils-s20100214.tpg//arping.c
--- iputils-s20100214//arping.c	2010-04-18 02:00:39.000000000 +0000
+++ iputils-s20100214.tpg//arping.c	2010-04-18 02:00:06.000000000 +0000
@@ -175,12 +175,17 @@
 	if (start.tv_sec==0)
 		start = tv;
 
-	if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
+	if (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500)
+ 		finish();
+
+	if ((!timeout) && (count == 0))
 		finish();
 
-	if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
+	if ( count!=0  && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
 		send_pack(s, src, dst, &me[0], &he[0]);
-		if (count == 0 && unsolicited)
+		if (count >= 0)
+			count--;
+		if (count==0 && unsolicited)
 			finish();
 	}
 	alarm(1);