--- arpspoof.c 2016-01-10 01:45:40.923295391 -0600 +++ arpspoof.c 2016-01-10 01:45:22.898295637 -0600 @@ -160,16 +160,27 @@ fprintf(stderr, "Cleaning up and re-arping targets...\n"); for (i = 0; i < rounds; i++) { struct host *target = targets; + + uint8_t *src_ha = NULL; + if (cleanup_src_own && (i%2 || !cleanup_src_host)) { + src_ha = my_ha; + } + + if (!target->ip && fw) { + /* XXX - on BSD, requires ETHERSPOOF kernel. */ + arp_send(l, ARPOP_REPLY, + (u_int8_t *)&spoof.mac, spoof.ip, + brd_ha, target->ip, src_ha); + /* we have to wait a moment before sending the next packet */ + sleep(1); + } + while(target->ip) { - uint8_t *src_ha = NULL; - if (cleanup_src_own && (i%2 || !cleanup_src_host)) { - src_ha = my_ha; - } /* XXX - on BSD, requires ETHERSPOOF kernel. */ if (fw) { arp_send(l, ARPOP_REPLY, (u_int8_t *)&spoof.mac, spoof.ip, - (target->ip ? (u_int8_t *)&target->mac : brd_ha), + (u_int8_t *)&target->mac, target->ip, src_ha); /* we have to wait a moment before sending the next packet */ @@ -296,9 +307,15 @@ for (;;) { struct host *target = targets; + + if (!target->ip) { + arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, + brd_ha, target->ip, my_ha); + } + while(target->ip) { arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, - (target->ip ? (u_int8_t *)&target->mac : brd_ha), + (u_int8_t *)&target->mac, target->ip, my_ha); if (poison_reverse) {