From nobody Mon Jan 30 11:33:50 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P55fl0kytz3cL2S; Mon, 30 Jan 2023 11:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P55fl00Spz47LZ; Mon, 30 Jan 2023 11:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675078431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+ETLrf/i+02EqmzGh/wk50z0uV6WTXBkp79YV8rH3s=; b=lkycDPTJ2OB9T/BZfxh4rr3Ecs7X85hehydRVyUgsGxR+6mRoOkpVUZOqNrnItrBxTekKJ bNfQJFRSJ+zTTIln51aD/ux7JYkMyKreU7PBciQzbpYsv7bSdBWVxx14gik3caWrzGo3hX Apj+vSKfV4xrWebNk6lA/GiTnYXnm/zULqI5kNTKyj+lMAKENvb47fDRXHXTrwTc7KaVa6 H6ciYViNpZFKvOmLzgl9D1P1Au8+RH/P8e1AfgDk+90wkQD9wkGuzbQwHQRQ0L+SJULHGr GdTIChQA20E9JqScFSAjYATlPeW+py5B8D3NLd0Q7+FShJudTy9PKn2zxVM4HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675078431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E+ETLrf/i+02EqmzGh/wk50z0uV6WTXBkp79YV8rH3s=; b=FUE9D+bqJtIvOdJN6k2HN6Qv9td2KhtqHfslcaSuqwh1Z2gV7HvU7fm3IRQSebqkUA7paL 10OeyImxEGWlrAO4aI+B4w0wqOvBh+icNQhwwFZAnbnWA7wKSDjWK4UbiIl34FpWHyKk5C b9UtjkZ1zZevnwSnsXtGl3/WB+LjYHsSku81PhMoWXtSrFoNVaAl2MZj+9Th95qOTnVWdc 1sjrph8wySjZ/LokJOM1jFsk1raDrW+2sCJ8BdfVfA1x/xhKZi0ndwgiwS7J8MrYJndz3E oLFJg02VfaJW6QtbjFLx5u0kmBAFCmVpxEtC32n9ghVL/ZN8wWsL+ZSx87Bo9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675078431; a=rsa-sha256; cv=none; b=SLzsF96vDEbuUKzt8fKGO0RPsmvFjn9DnghL46cfELX2/9PLh1TM8yz8bc7Tz63ZUsuJU7 fF7RqHBCyGwA3r4hQodPrZq9AP+Y9+1Qclg/66WfWAP8fR/nBU31XwwwtfO4yW2JGbr8gr eFssIp9fsTGD1V4YMhXc4aK3Srwj/QZCZs7lxInGPqei8Y8U+0aqJH/iAud49QqzW7DYz+ +EdxtLKzstkqGONLIBXGUVEYfTK9cWh1ImoQ19MwjB4OzLua5Bb68XqkA6rHpDnSa8nIa1 TgT8sfeHMSceFxIegHsVS821e9iu3HRmSFyIwR2Qj9bZPAvWBszIUE0+XjAFNA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P55fk68csz1630; Mon, 30 Jan 2023 11:33:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30UBXoLV015531; Mon, 30 Jan 2023 11:33:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30UBXo0Y015530; Mon, 30 Jan 2023 11:33:50 GMT (envelope-from git) Date: Mon, 30 Jan 2023 11:33:50 GMT Message-Id: <202301301133.30UBXo0Y015530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: ee49c5d33d93 - main - carp: turn net.inet.carp.allow into a RW tunable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee49c5d33d93a6b10222f64a0dc16590ac2048a0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=ee49c5d33d93a6b10222f64a0dc16590ac2048a0 commit ee49c5d33d93a6b10222f64a0dc16590ac2048a0 Author: Boris Lytochkin AuthorDate: 2023-01-29 16:42:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-01-30 11:23:53 +0000 carp: turn net.inet.carp.allow into a RW tunable Currently CARP starts announcing its state when initialised, regardless of the state of the other services provided by the server. As a result, the device can become master while still loading the firewall ruleset or initialising long-starting service. This change adds the way to request delayed CARP start by setting the net.inet.carp.allow=0 in the loader.conf. Differential Revision: https://reviews.freebsd.org/D38167 MFC after: 2 weeks --- sys/netinet/ip_carp.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 7c0318c82e75..3846576b4482 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -216,8 +216,8 @@ 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_RW | CTLFLAG_MPSAFE, - 0, 0, carp_allow_sysctl, "I", + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + &VNET_NAME(carp_allow), 0, carp_allow_sysctl, "I", "Accept incoming CARP packets"); SYSCTL_PROC(_net_inet_carp, OID_AUTO, dscp, CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, @@ -2197,6 +2197,15 @@ carp_mod_cleanup(void) sx_destroy(&carp_sx); } +static void +ipcarp_sysinit(void) +{ + + /* Load allow as tunable so to postpone carp start after module load */ + TUNABLE_INT_FETCH("net.inet.carp.allow", &V_carp_allow); +} +VNET_SYSINIT(ip_carp, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipcarp_sysinit, NULL); + static int carp_mod_load(void) {