git: d67b1748ea34 - stable/14 - carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Jan 2025 15:42:40 UTC
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d67b1748ea34ad6f66072694fd8b623ab0ea72b1 commit d67b1748ea34ad6f66072694fd8b623ab0ea72b1 Author: Zhenlei Huang <zlei@FreeBSD.org> AuthorDate: 2023-09-09 08:10:32 +0000 Commit: Zhenlei Huang <zlei@FreeBSD.org> CommitDate: 2025-01-24 15:41:09 +0000 carp: Explicitly mark tunnable net.inet.carp.allow with CTLFLAG_NOFETCH With recent change 110113bc086f, a vnet tunable can be initialized when there is a corresponding kernel environment variable unless it is marked with the flag CTLFLAG_NOFETCH. The initialization may happen during early boot(linker preload), at that time vnet0 has not been created. The hander carp_allow_sysctl() for the tunable net.inet.carp.allow requires vnet, thus invoking it during early boot will cause kernel panic. The tunnable is initialized by vnet sysinit routine ipcarp_sysinit() so let's just mark it with flag CTLFLAG_NOFETCH. No functional change intended. Fixes: 110113bc086f sysctl(9): Enable vnet sysctl variables to be loader tunable MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D41525 (cherry picked from commit 242fa308f3c3def32b2e61e0b78c11b3697e4492) --- sys/netinet/ip_carp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 335cb42613bf..ddbc13e7c878 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -237,7 +237,7 @@ static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "CARP"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, allow, - CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, &VNET_NAME(carp_allow), 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp,