@@ -148,20 +148,16 @@ * @struct OFSocketAddress OFSocket.h ObjFW/OFSocket.h * * @brief A struct which represents a host / port pair for a socket. */ typedef struct OF_BOXABLE { + OFSocketAddressFamily family; /* - * Even though struct sockaddr contains the family, we need to use our - * own family, as we need to support storing an IPv6 address on systems - * that don't support IPv6. These may not have AF_INET6 defined and we - * can't just define it, as the value is system-dependent and might - * clash with an existing value. + * We can't use struct sockaddr as it can contain variable length + * arrays. */ - OFSocketAddressFamily family; union { - struct sockaddr sockaddr; struct sockaddr_in in; struct sockaddr_in6 in6; struct sockaddr_un un; struct sockaddr_ipx ipx; } sockaddr;