From: Matt Caswell Date: Fri, 8 Sep 2023 14:26:40 +0000 (+0100) Subject: Fix a build failure where recvmmsg is available but not sendmmsg X-Git-Tag: openssl-3.2.0-alpha2~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d96106c43d5b4e2d97406e5d3934323ae5bd1b4;p=thirdparty%2Fopenssl.git Fix a build failure where recvmmsg is available but not sendmmsg 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 Reviewed-by: Tomas Mraz Reviewed-by: Tim Hudson Reviewed-by: Tom Cosgrove (Merged from https://github.com/openssl/openssl/pull/22036) --- diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index b0c08b362a7..3f57de539f4 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -50,6 +50,17 @@ # 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