From 1b34e43109b8b48516fc07c63b201bbb3e53a295 Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 19 Mar 2019 18:55:42 -0400 Subject: [PATCH] Feature gate SO_INCOMING_CPU so we compile on older kernels Former-commit-id: 267e84f97d61f8aa416f88870c21bdf2a0cc635a --- src/fmacros.h | 5 +++++ src/networking.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/fmacros.h b/src/fmacros.h index a56bb9331..ea663e1a3 100644 --- a/src/fmacros.h +++ b/src/fmacros.h @@ -35,7 +35,12 @@ #if defined(__linux__) #define _GNU_SOURCE 1 #define _DEFAULT_SOURCE 1 + +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) +#define HAVE_SO_INCOMING_CPU 1 #endif +#endif // __linux__ #if defined(_AIX) #define _ALL_SOURCE diff --git a/src/networking.cpp b/src/networking.cpp index b608370fb..4a6794d98 100644 --- a/src/networking.cpp +++ b/src/networking.cpp @@ -1035,6 +1035,7 @@ static void acceptCommonHandler(int fd, int flags, char *ip, int iel) { return; } +#ifdef HAVE_SO_INCOMING_CPU // Set thread affinity if (server.fThreadAffinity) { @@ -1044,6 +1045,7 @@ static void acceptCommonHandler(int fd, int flags, char *ip, int iel) { serverLog(LL_WARNING, "Failed to set socket affinity"); } } +#endif /* If maxclient directive is set and this is one client more... close the * connection. Note that we create the client instead to check before