Hello,
I've been testing the behaviour of arping with and without the proposed patch,
using the manpage as a guide of how it should work. As a result, I made
another patch that, hopefully, makes arping work as documented.
Please, consider the patch and apply in the next upload, as programs should
work as documented.
Thanks.
diff -rNu iputils-20020927/arping.c iputils-20020927.new/arping.c
--- iputils-20020927/arping.c 2001-10-05 19:42:47.000000000 -0300
+++ iputils-20020927.new/arping.c 2006-08-05 20:35:43.000000000 -0300
@@ -166,12 +166,17 @@
if (start.tv_sec==0)
start = tv;
- if (count-- == 0 || (timeout && MS_TDIFF(tv,start) > timeout*1000 + 500))
- finish();
+ 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, &me, &he);
- if (count == 0 && unsolicited)
+ if (count >= 0)
+ count--;
+ if (count==0 && unsolicited)
finish();
}
alarm(1);