Details
-
Task
-
Status: In Review (View Workflow)
-
Minor
-
Resolution: Unresolved
Description
resolveip: replace inet_aton/inet_addr, gethostbyname, gethostbyaddr, inet_ntoa with inet_pton, getaddrinfo, getnameinfo, inet_ntop.
These deprecated functions are IPv4-only and some are not thread-safe (gethostbyname, gethostbyaddr, and inet_ntoa use static internal buffers). The modernized code:
Adds IPv6 support for both forward and reverse lookups
Uses thread-safe APIs throughout
Eliminates the #ifdef WIN32 code path split (inet_pton works on both)
Removes the h_errno dependency (replaced by gai_strerror)
Uses AF_UNSPEC with getaddrinfo to return both IPv4 and IPv6 results
Preserves existing output format, exit codes, and special cases (Broadcast, Null-IP-Addr, Old-Bcast)
Bump version from 2.3 to 2.4 to reflect the API change.
Update Solaris library search in CMakeLists.txt from inet_aton to getaddrinfo since the old function is no longer referenced.