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