Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1521,10 +1521,25 @@ ]) AC_CHECK_MEMBER(struct sockaddr_un.sun_path, [ AC_DEFINE(OF_HAVE_UNIX_SOCKETS, 1, [Whether we have UNIX sockets]) AC_SUBST(USE_SRCS_UNIX_SOCKETS, '${SRCS_UNIX_SOCKETS}') + + AC_CHECK_MEMBERS(struct sockaddr_un.sun_len, [], [], [ + #ifdef OF_HAVE_SYS_TYPES_H + # include + #endif + #ifdef OF_HAVE_SYS_UN_H + # include + #endif + #ifdef _WIN32 + # include + #endif + #ifdef HAVE_AFUNIX_H + # include + #endif + ]) ], [], [ #ifdef OF_HAVE_SYS_TYPES_H # include #endif #ifdef OF_HAVE_SYS_UN_H Index: src/OFSocket.m ================================================================== --- src/OFSocket.m +++ src/OFSocket.m @@ -588,10 +588,13 @@ memset(&ret, '\0', sizeof(ret)); ret.family = OFSocketAddressFamilyUNIX; ret.length = (socklen_t) (offsetof(struct sockaddr_un, sun_path) + length); +#ifdef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN + ret.sockaddr.un.sun_len = (uint8_t)length; +#endif #ifdef AF_UNIX ret.sockaddr.un.sun_family = AF_UNIX; #else ret.sockaddr.un.sun_family = AF_UNSPEC; #endif