Speedup of the listening function

Reduced the number of frames to consider before giving up
This commit is contained in:
Dimitri Lozeve 2016-05-27 15:14:23 +02:00
parent 10ac6265cd
commit 5c873a958b

2
arp.c
View file

@ -189,7 +189,7 @@ int listen_arp_frame(int sockfd, struct ether_arp *result)
int count = 0; int count = 0;
while (recv(sockfd, buffer, sizeof(buffer), 0) && count < 100) { while (recv(sockfd, buffer, sizeof(buffer), 0) && count < 10) {
/* skip to the next frame if it's not an ARP REPLY */ /* skip to the next frame if it's not an ARP REPLY */
if (ntohs (result->arp_op) != ARPOP_REPLY) { if (ntohs (result->arp_op) != ARPOP_REPLY) {
++count; ++count;