From 30c8f3a80f70c724a3ed57c8dcfd3a5e2ef4b426 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 1 Jun 2022 12:32:04 +0100 Subject: [PATCH] Fix GH-8674: sockets extension won't build for older Linux kernels In abscence of the needed header, disable the feature altogether. Closes GH-8677. --- configure.ac | 1 + ext/sockets/sockets.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 422bfac9acd..8887c2aea65 100644 --- a/configure.ac +++ b/configure.ac @@ -395,6 +395,7 @@ fcntl.h \ grp.h \ ieeefp.h \ langinfo.h \ +linux/sock_diag.h \ malloc.h \ poll.h \ pty.h \ diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index f5843d5d4d7..fec1e5159c5 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -55,8 +55,10 @@ # if HAVE_IF_NAMETOINDEX # include # endif -# ifdef SO_MEMINFO +# if defined(HAVE_LINUX_SOCK_DIAG_H) # include +# else +# undef SO_MEMINFO # endif #endif