[RFC PATCH net-next 0/3] netns: optionally inherit IPv4 TCP sysctls from old net

From: nmreadelf

Date: Wed Apr 29 2026 - 21:33:21 EST


a new network namespace starts with built-in TCP defaults.
In container-heavy setups, operators often tune TCP sysctls in init_net and then
need to re-apply the same values for each new netns.

This series adds an opt-in mechanism to initialize per-netns IPv4 TCP sysctl
settings from init_net at netns creation time.

Behavior:

Default is unchanged.
When net.ipv4.netns_inherit_tcp_sysctls=1, new netns inherit
TCP sysctl from old_net.

nmreadelf (3):
ipv4: netns: group copyable TCP sysctls in netns_ipv4
net: ipv4: add netns_inherit_tcp_sysctls sysctl
tcp: netns: optionally inherit IPv4 TCP sysctls from parent netns

.../net_cachelines/netns_ipv4_sysctl.rst | 25 +++----
include/net/netns/ipv4.h | 33 +++++----
net/core/net_namespace.c | 72 +++++++++++++++++++
net/ipv4/sysctl_net_ipv4.c | 9 +++
4 files changed, 114 insertions(+), 25 deletions(-)

--
2.47.3