HomeFreeBSD

tcp: Fix expiring and purging hostcache entries of vnet jails

Description

tcp: Fix expiring and purging hostcache entries of vnet jails

A jailed process, sysctl -j foo or jexec foo sysctl, do not have
privilege to write to non-vnet sysctls but only to those marked as jail
writable, aka sysctls those marked with CTLFLAG_VNET flag.

Without this change we will get EPERM when trying to expire and purge
hostcache entries of vnet jails via the net.inet.tcp.hostcache.purgenow
sysctl. Fix that by adding a CTLFLAG_VNET flag.

Reviewed by: tuexen, transport, network
Fixes: 264563806496 Add a new sysctl net.inet.tcp.hostcache.purgenow=1 to expire ...
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D52692

(cherry picked from commit 33ceb31e256e386da5a42cc7ca2ef8d4b81b6eda)
(cherry picked from commit fa30199a3dbfe1d4994e7e4e63ad9c582c6f8a1a)

Details

Provenance
zleiAuthored on Sep 24 2025, 1:16 AM
Reviewer
transport
Differential Revision
D52692: tcp: Fix expiring and purging hostcache entries of vnet jails
Parents
rG1bd02c42131a: ifconfig: Display the IFCAP_HWSTATS capability without netlink
Branches
Unknown
Tags
Unknown