Rules of thumb (2) Pointers: use struct sockaddr * Memory allocation: use struct sockaddr_storage sizeof sockaddr < sizeof sockaddr_in6 Be careful with sizeof() sizeof(struct sockaddr_in)? sizeof(sa)? Use sa_len where possible (but not for 4.3BSD-based sockets) Name resolution must use getaddrinfo()/getnameinfo()