1 diff -up iputils-s20070202/arping.c.arping_timeout iputils-s20070202/arping.c
2 --- iputils-s20070202/arping.c.arping_timeout 2008-02-18 16:51:36.000000000 +0100
3 +++ iputils-s20070202/arping.c 2008-02-18 16:54:03.000000000 +0100
4 @@ -45,7 +45,8 @@ struct in_addr src, dst;
6 int dad, unsolicited, advert;
14 @@ -59,7 +60,7 @@ int broadcast_only;
15 struct sockaddr_ll me[2];
16 struct sockaddr_ll he[2];
18 -struct timeval start, last;
22 int received, brd_recv, req_recv;
23 @@ -172,13 +173,15 @@ void catcher(void)
25 gettimeofday(&tv, NULL);
27 - if (start.tv_sec==0)
30 - if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
32 + if (!forever && count == 0) {
33 + if (timeout && MS_TDIFF(tv, last) > timeout * 1000 + 500)
39 - if (last.tv_sec==0 || MS_TDIFF(tv,last) > 500) {
40 + if ((count > 0 || forever) && (last.tv_sec == 0 || MS_TDIFF(tv, last) > 500)) {
42 send_pack(s, src, dst, &me[0], &he[0]);
43 if (count == 0 && unsolicited)
45 @@ -339,6 +342,10 @@ main(int argc, char **argv)
55 timeout = atoi(optarg);
56 @@ -544,7 +551,8 @@ main(int argc, char **argv)
57 sigaddset(&sset, SIGALRM);
58 sigaddset(&sset, SIGINT);
59 sigprocmask(SIG_BLOCK, &sset, &osset);
60 - recv_pack(packet, cc, &from[0]);
61 + if (recv_pack(packet, cc, from) && count == 0 && !forever)
63 sigprocmask(SIG_SETMASK, &osset, NULL);