Setting `hints.ai_family` to `AF_UNSPEC` was causing `net_getaddrinfo_addr_str()` and in turn `getaddrinfo()` to resolve the literal SNTP SERVER first into IPv4 and then (if supported) IPv6 addresses. This was causing useless waste of time and memory in case IPv4 was not supported. In addition, in case IPv4 addresses were not supported, other system components (eg. SNTP) could fail due to the DNS returning IP addresses with unsupported family type (ie. IPv4). Now, if address family is not explicitly set to `AF_INET` (ie. IPv4), then no attempt is made to resolve SNTP server address into an IPv4 address. Signed-off-by: Marco Argiolas <marco.argiolas@ftpsolutions.com.au> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| getaddrinfo.c | ||
| getnameinfo.c | ||
| Kconfig | ||
| socket_dispatcher.c | ||
| socket_offload.c | ||
| socketpair.c | ||
| sockets_can.c | ||
| sockets_internal.h | ||
| sockets_misc.c | ||
| sockets_net_mgmt.c | ||
| sockets_packet.c | ||
| sockets_select.c | ||
| sockets_tls.c | ||
| sockets.c | ||