The branch stable/13 has been updated by zlei:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=353cf44d828c0b43ad34dab7ab4572186087a331

commit 353cf44d828c0b43ad34dab7ab4572186087a331
Author:     Zhenlei Huang <z...@freebsd.org>
AuthorDate: 2023-09-09 08:10:32 +0000
Commit:     Zhenlei Huang <z...@freebsd.org>
CommitDate: 2025-01-27 18:32:59 +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)
    (cherry picked from commit d67b1748ea34ad6f66072694fd8b623ab0ea72b1)
---
 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 cc7add7c3d64..9b651ac2eba1 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -219,7 +219,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,

Reply via email to