Rules of thumb (1) Do not use in_addr and in6_addr Use sockaddr, sockaddr_in and sockaddr_in6 (Using u_long for IPv6 is out of question) in6_addr does not identify peer (no scope information) Do not use functions that deals with in_addr/in6_addr gethostbyname gethostbyaddr getipnodebyname getipnodebyaddr inet_ntop inet_pton inet_aton inet_ntoa