Bugfix: scan returned wrong IP addresses

This commit is contained in:
Dimitri Lozeve 2016-06-03 16:45:30 +02:00
parent 47d05784f9
commit 7ebbccbbac

View file

@ -164,7 +164,9 @@ int main(int argc, char **argv)
struct ether_arp *result = malloc(sizeof(struct ether_arp)); struct ether_arp *result = malloc(sizeof(struct ether_arp));
int isalive = listen_arp_frame(sockfd, result); int isalive = listen_arp_frame(sockfd, result);
if (isalive == 0) { if (isalive == 0) {
printf("Host %s is alive!\n", ip_string); printf("Host %d.%d.%d.%d is alive!\n",
result->arp_spa[0],result->arp_spa[1],
result->arp_spa[2],result->arp_spa[3]);
} }
++ip_counter; ++ip_counter;