From d960c51ee4aa41867e275ffaeb2defc9ba0d6be3 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 17 Dec 2021 22:15:51 +0000 Subject: [PATCH 10/20] sys/socket.h: add SO_BUF_LOCK from linux v5.15 sockopt for enabling automatic socket buffer adjustment, needed for CRIU to restore socket state and avoid network performance loss. SOCK_ is not reserved for sys/socket.h but we seem to rely on it. see linux commit 04190bf8944deb7e3ac165a1a494db23aa0160a9 sock: allow reading and changing sk_userlocks with setsockopt --- include/sys/socket.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/sys/socket.h b/include/sys/socket.h index 50cc50f7..84d27cc8 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -294,6 +294,11 @@ struct linger { #define SO_PREFER_BUSY_POLL 69 #define SO_BUSY_POLL_BUDGET 70 #define SO_NETNS_COOKIE 71 +#define SO_BUF_LOCK 72 + +#define SOCK_SNDBUF_LOCK 1 +#define SOCK_RCVBUF_LOCK 2 +#define SOCK_BUF_LOCK_MASK (SOCK_SNDBUF_LOCK | SOCK_RCVBUF_LOCK) #ifndef SOL_SOCKET #define SOL_SOCKET 1 -- 2.35.1