File: fix-arping-timeouts.diff

package info (click to toggle)
iputils 3%3A20101006-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,944 kB
  • sloc: ansic: 8,451; perl: 585; makefile: 170; sh: 37
file content (24 lines) | stat: -rw-r--r-- 759 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Index: trunk/arping.c
===================================================================
--- trunk.orig/arping.c	2010-05-07 23:13:52.000000000 -0700
+++ trunk/arping.c	2010-05-07 23:41:16.000000000 -0700
@@ -182,12 +182,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 (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
+	if ((!timeout) && (count == 0))
+		finish();
+
+	if ( count!=0  && (last.tv_sec==0 || MS_TDIFF(tv,last) > 500 ) ) {
 		send_pack(s, src, dst,
 			  (struct sockaddr_ll *)&me, (struct sockaddr_ll *)&he);
+		if (count >= 0)
+		    count--;
 		if (count == 0 && unsolicited)
 			finish();
 	}