Commit 52cd2a49c5 for openssl.org
commit 52cd2a49c53ee6b08a8a76624f2a80f00248d679
Author: Matthias Kraft <Matthias.Kraft@ibm.com>
Date: Fri Dec 5 17:52:28 2025 +0100
Enable send-/recvmmsg for AIX >= 7.2 and disable SUPPORT_LOCAL_ADDR.
AIX doesn't support this implementation for local addresses. The AF_INET
case is unimplemented when sending. The AF_INET6 case is limited to 110
messages. The limiting factor is currently unclear.
Fixes #29292
Signed-off-by: Matthias Kraft <Matthias.Kraft@ibm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29334)
diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index b723733825..1f62ecf844 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -64,7 +64,12 @@
#undef NO_RECVMSG
#define NO_RECVMSG
#endif
-#if (defined(__ANDROID_API__) && __ANDROID_API__ < 21) || defined(_AIX)
+#if (defined(__ANDROID_API__) && __ANDROID_API__ < 21)
+#undef NO_RECVMMSG
+#define NO_RECVMMSG
+#endif
+#if defined(_AIX) && !defined(_AIX72)
+/* AIX >= 7.2 provides sendmmsg() and recvmmsg(). */
#undef NO_RECVMMSG
#define NO_RECVMMSG
#endif
@@ -130,7 +135,14 @@
BIO_MAX(BIO_CMSG_ALLOC_LEN_1, \
BIO_MAX(BIO_CMSG_ALLOC_LEN_2, BIO_CMSG_ALLOC_LEN_3))
#endif
-#if (defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)) && defined(IPV6_RECVPKTINFO)
+/*
+ * Although AIX defines IP_RECVDSTADDR and IPV6_RECVPKTINFO, the
+ * implementation requires IP_PKTINFO to be available for AF_INET.
+ * For AF_INET6 there seem to be limitations how local addresses
+ * are handled on AIX. So, disable the support for now.
+ */
+#if (defined(IP_PKTINFO) || defined(IP_RECVDSTADDR)) && defined(IPV6_RECVPKTINFO) \
+ && !defined(_AIX)
#define SUPPORT_LOCAL_ADDR
#endif
#endif