--- source/posix/socket.c 2025-07-29 04:45:52.000000000 +0800 +++ source/posix/socket.c 2025-08-18 15:51:05.000000000 +0800 @@ -1410,6 +1410,7 @@ return aws_raise_error(AWS_IO_SOCKET_INVALID_OPTIONS); } if (options->domain == AWS_SOCKET_IPV6) { +#ifdef IPV6_BOUND_IF if (setsockopt( socket->io_handle.data.fd, IPPROTO_IPV6, @@ -1426,6 +1427,7 @@ errno_value); return aws_raise_error(AWS_IO_SOCKET_INVALID_OPTIONS); } +#endif } else if (setsockopt( socket->io_handle.data.fd, IPPROTO_IP, @@ -1466,7 +1468,7 @@ } } -#if !defined(__OpenBSD__) +#if !defined(__OpenBSD__) && !defined(__APPLE__) if (socket->options.keep_alive_interval_sec && socket->options.keep_alive_timeout_sec) { int ival_in_secs = socket->options.keep_alive_interval_sec; if (AWS_UNLIKELY(setsockopt(