Don't use inet_ntoa() any more
This commit is contained in:
parent
2c1697b78a
commit
a0005e9dad
3
TODO
3
TODO
|
@ -43,9 +43,6 @@
|
||||||
- Refactor:
|
- Refactor:
|
||||||
° monitor_requests()
|
° monitor_requests()
|
||||||
° got_request()
|
° 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?
|
- Use the type of a request to identify it?
|
||||||
(along with the mobile MAC address and the request time)
|
(along with the mobile MAC address and the request time)
|
||||||
- got_request(): option for the maximal difference time
|
- got_request(): option for the maximal difference time
|
||||||
|
|
|
@ -942,7 +942,7 @@ void* listen_for_aps(void *NULL_value)
|
||||||
continue ;
|
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)
|
if (VERBOSE_INFO)
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
|
@ -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)],
|
memcpy(&ip_addr, &ifr.ifr_addr.sa_data[sizeof(sa.sin_port)],
|
||||||
sizeof(ip_addr)) ;
|
sizeof(ip_addr)) ;
|
||||||
strncpy(ip, inet_ntoa(ip_addr), INET_ADDRSTRLEN) ;
|
inet_ntop(AF_INET, &ip_addr, ip, INET_ADDRSTRLEN) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue