- MALLOC(sa, struct sockaddr *, len, M_SONAME, M_WAITOK | M_ZERO);
+ /*
+ * Workaround for rdar://23362120
+ * Allways allocate a buffer that can hold an IPv6 socket address
+ */
+ alloclen = MAX(len, sizeof(struct sockaddr_in6));
+ MALLOC(sa, struct sockaddr *, alloclen, M_SONAME, M_WAITOK | M_ZERO);