Don't use inet_ntoa() any more

This commit is contained in:
Matteo Cypriani 2012-01-26 10:15:10 +01:00
parent 2c1697b78a
commit a0005e9dad
3 changed files with 2 additions and 5 deletions

3
TODO
View File

@ -43,9 +43,6 @@
- Refactor:
° monitor_requests()
° got_request()
- inet_ntoa() is not secure with threads
(But it is currently used by only one thread.) Use inet_ntop()
instead?
- Use the type of a request to identify it?
(along with the mobile MAC address and the request time)
- got_request(): option for the maximal difference time

View File

@ -942,7 +942,7 @@ void* listen_for_aps(void *NULL_value)
continue ;
}
strncpy(ap_ip_addr, inet_ntoa(client.sin_addr), INET_ADDRSTRLEN) ;
inet_ntop(AF_INET, &client.sin_addr, ap_ip_addr, INET_ADDRSTRLEN) ;
if (VERBOSE_INFO)
fprintf(stderr,

View File

@ -1272,7 +1272,7 @@ void get_ip_addr(char *eth, char ip[INET_ADDRSTRLEN])
memcpy(&ip_addr, &ifr.ifr_addr.sa_data[sizeof(sa.sin_port)],
sizeof(ip_addr)) ;
strncpy(ip, inet_ntoa(ip_addr), INET_ADDRSTRLEN) ;
inet_ntop(AF_INET, &ip_addr, ip, INET_ADDRSTRLEN) ;
}