]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a build failure where recvmmsg is available but not sendmmsg
authorMatt Caswell <matt@openssl.org>
Fri, 8 Sep 2023 14:26:40 +0000 (15:26 +0100)
committerHugo Landau <hlandau@openssl.org>
Mon, 11 Sep 2023 06:43:26 +0000 (07:43 +0100)
Some old glibc versions have recvmmsg but not sendmmsg. We require both to
use that functionality. Introduce a test to check we have a sufficiently
recent version of glibc.

Fixes #22021

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/22036)

crypto/bio/bss_dgram.c

index b0c08b362a70a02b386654fc1cacdaaed735c374..3f57de539f4516fc3450316b2d888edf0a900ca5 100644 (file)
 # define M_METHOD_RECVFROM   3
 # define M_METHOD_WSARECVMSG 4
 
+# if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+#  if !(__GLIBC_PREREQ(2, 14))
+#   undef NO_RECVMMSG
+    /*
+     * Some old glibc versions may have recvmmsg and MSG_WAITFORONE flag, but
+     * not sendmmsg. We need both so force this to be disabled on these old
+     * versions
+     */
+#   define NO_RECVMMSG
+#  endif
+# endif
 # if !defined(M_METHOD)
 #  if defined(OPENSSL_SYS_WINDOWS) && defined(BIO_HAVE_WSAMSG) && !defined(NO_WSARECVMSG)
 #   define M_METHOD  M_METHOD_WSARECVMSG