iputils/iputils-20020927-12-arping.patch

26 lines
774 B
Diff
Raw Normal View History

2005-08-12 10:08:18 +00:00
--- iputils/arping.c.orig 2001-10-05 18:42:47.000000000 -0400
+++ iputils/arping.c 2005-07-13 13:07:45.406217716 -0400
@@ -166,10 +166,12 @@ void catcher(void)
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) ||
+ ((count == 0) && (!timeout)))
finish();
if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
+ count--;
send_pack(s, src, dst, &me, &he);
if (count == 0 && unsolicited)
finish();
@@ -510,6 +512,8 @@ main(int argc, char **argv)
sigaddset(&sset, SIGINT);
sigprocmask(SIG_BLOCK, &sset, &osset);
recv_pack(packet, cc, &from);
+ if(received == count)
+ exit(0);
sigprocmask(SIG_SETMASK, &osset, NULL);
}
}