--- iputils-vanilla/arping.c Tue Sep 26 19:01:43 2000 +++ iputils/arping.c Thu Nov 23 12:14:41 2000 @@ -46,6 +46,7 @@ int timeout; int unicasting; int s; +int broadcast_only; struct sockaddr_ll me; struct sockaddr_ll he; @@ -61,8 +62,9 @@ void usage(void) { fprintf(stderr, - "Usage: arping [-fDUAV] [-c count] [-w timeout] [-I device] [-s source] destination\n" + "Usage: arping [-fbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination\n" " -f : quit on first reply\n" + " -b : keep broadcasting, don't go unicast\n" " -D : duplicate address detection mode\n" " -U : Unsolicited ARP mode, update your neighbours\n" " -A : ARP answer mode, update your neighbours\n" @@ -284,8 +286,10 @@ req_recv++; if (quit_on_reply) finish(); - memcpy(he.sll_addr, p, me.sll_halen); - unicasting=1; + if(!broadcast_only) { + memcpy(he.sll_addr, p, me.sll_halen); + unicasting=1; + } return 1; } @@ -302,8 +306,11 @@ } setuid(uid); - while ((ch = getopt(argc, argv, "fDUAqc:w:s:I:V")) != EOF) { + while ((ch = getopt(argc, argv, "bfDUAqc:w:s:I:V")) != EOF) { switch(ch) { + case 'b': + broadcast_only=1; + break; case 'D': dad++; quit_on_reply=1;