Lines 160-175
Link Here
|
160 |
fprintf(stderr, "Cleaning up and re-arping targets...\n"); |
160 |
fprintf(stderr, "Cleaning up and re-arping targets...\n"); |
161 |
for (i = 0; i < rounds; i++) { |
161 |
for (i = 0; i < rounds; i++) { |
162 |
struct host *target = targets; |
162 |
struct host *target = targets; |
|
|
163 |
|
164 |
uint8_t *src_ha = NULL; |
165 |
if (cleanup_src_own && (i%2 || !cleanup_src_host)) { |
166 |
src_ha = my_ha; |
167 |
} |
168 |
|
169 |
if (!target->ip && fw) { |
170 |
/* XXX - on BSD, requires ETHERSPOOF kernel. */ |
171 |
arp_send(l, ARPOP_REPLY, |
172 |
(u_int8_t *)&spoof.mac, spoof.ip, |
173 |
brd_ha, target->ip, src_ha); |
174 |
/* we have to wait a moment before sending the next packet */ |
175 |
sleep(1); |
176 |
} |
177 |
|
163 |
while(target->ip) { |
178 |
while(target->ip) { |
164 |
uint8_t *src_ha = NULL; |
|
|
165 |
if (cleanup_src_own && (i%2 || !cleanup_src_host)) { |
166 |
src_ha = my_ha; |
167 |
} |
168 |
/* XXX - on BSD, requires ETHERSPOOF kernel. */ |
179 |
/* XXX - on BSD, requires ETHERSPOOF kernel. */ |
169 |
if (fw) { |
180 |
if (fw) { |
170 |
arp_send(l, ARPOP_REPLY, |
181 |
arp_send(l, ARPOP_REPLY, |
171 |
(u_int8_t *)&spoof.mac, spoof.ip, |
182 |
(u_int8_t *)&spoof.mac, spoof.ip, |
172 |
(target->ip ? (u_int8_t *)&target->mac : brd_ha), |
183 |
(u_int8_t *)&target->mac, |
173 |
target->ip, |
184 |
target->ip, |
174 |
src_ha); |
185 |
src_ha); |
175 |
/* we have to wait a moment before sending the next packet */ |
186 |
/* we have to wait a moment before sending the next packet */ |
Lines 296-304
Link Here
|
296 |
|
307 |
|
297 |
for (;;) { |
308 |
for (;;) { |
298 |
struct host *target = targets; |
309 |
struct host *target = targets; |
|
|
310 |
|
311 |
if (!target->ip) { |
312 |
arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, |
313 |
brd_ha, target->ip, my_ha); |
314 |
} |
315 |
|
299 |
while(target->ip) { |
316 |
while(target->ip) { |
300 |
arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, |
317 |
arp_send(l, ARPOP_REPLY, my_ha, spoof.ip, |
301 |
(target->ip ? (u_int8_t *)&target->mac : brd_ha), |
318 |
(u_int8_t *)&target->mac, |
302 |
target->ip, |
319 |
target->ip, |
303 |
my_ha); |
320 |
my_ha); |
304 |
if (poison_reverse) { |
321 |
if (poison_reverse) { |