From 21bdac22fb216d8276f682023367564c9209d19f Mon Sep 17 00:00:00 2001 From: Gerlando Falauto Date: Tue, 16 Jan 2024 11:44:07 +0100 Subject: [PATCH] fix(driver): add preprocessor guards for oldest 2.6.32 kernels recent updates to the driver broke the driver build for very ancient 2.6.32 kernels on CentOS 6 (e.g. 2.6.32-71.24.1.el6): socketcall_to_syscall.h:208:7: error: 'SYS_SENDMMSG' undeclared (first use in this function) case SYS_SENDMMSG: ^ So add the appropriate preprocessor guards to get it to compile. Signed-off-by: Gerlando Falauto --- driver/socketcall_to_syscall.h | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/driver/socketcall_to_syscall.h b/driver/socketcall_to_syscall.h index cbdc6c0670..2200cc1d87 100644 --- a/driver/socketcall_to_syscall.h +++ b/driver/socketcall_to_syscall.h @@ -151,65 +151,105 @@ static inline int socketcall_code_to_syscall_code(int socketcall_code, bool* is_ switch(socketcall_code) { +#ifdef SYS_SOCKET case SYS_SOCKET: return PPME_SOCKET_SOCKET_E; +#endif +#ifdef SYS_SOCKETPAIR case SYS_SOCKETPAIR: return PPME_SOCKET_SOCKETPAIR_E; +#endif +#ifdef SYS_ACCEPT case SYS_ACCEPT: return PPME_SOCKET_ACCEPT_5_E; +#endif +#ifdef SYS_ACCEPT4 case SYS_ACCEPT4: return PPME_SOCKET_ACCEPT4_6_E; +#endif +#ifdef SYS_BIND case SYS_BIND: return PPME_SOCKET_BIND_E; +#endif +#ifdef SYS_LISTEN case SYS_LISTEN: return PPME_SOCKET_LISTEN_E; +#endif +#ifdef SYS_CONNECT case SYS_CONNECT: return PPME_SOCKET_CONNECT_E; +#endif +#ifdef SYS_GETSOCKNAME case SYS_GETSOCKNAME: return PPME_SOCKET_GETSOCKNAME_E; +#endif +#ifdef SYS_GETPEERNAME case SYS_GETPEERNAME: return PPME_SOCKET_GETPEERNAME_E; +#endif +#ifdef SYS_GETSOCKOPT case SYS_GETSOCKOPT: return PPME_SOCKET_GETSOCKOPT_E; +#endif +#ifdef SYS_SETSOCKOPT case SYS_SETSOCKOPT: return PPME_SOCKET_SETSOCKOPT_E; +#endif +#ifdef SYS_RECV case SYS_RECV: return PPME_SOCKET_RECV_E; +#endif +#ifdef SYS_RECVFROM case SYS_RECVFROM: return PPME_SOCKET_RECVFROM_E; +#endif +#ifdef SYS_RECVMSG case SYS_RECVMSG: return PPME_SOCKET_RECVMSG_E; +#endif +#ifdef SYS_RECVMMSG case SYS_RECVMMSG: return PPME_SOCKET_RECVMMSG_E; +#endif +#ifdef SYS_SEND case SYS_SEND: return PPME_SOCKET_SEND_E; +#endif +#ifdef SYS_SENDTO case SYS_SENDTO: return PPME_SOCKET_SENDTO_E; +#endif +#ifdef SYS_SENDMSG case SYS_SENDMSG: return PPME_SOCKET_SENDMSG_E; +#endif +#ifdef SYS_SENDMMSG case SYS_SENDMMSG: return PPME_SOCKET_SENDMMSG_E; +#endif +#ifdef SYS_SHUTDOWN case SYS_SHUTDOWN: return PPME_SOCKET_SHUTDOWN_E; +#endif default: break;