From nobody Thu Feb 09 16:44:37 2023 X-Original-To: dev-commits-src-all@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 4PCN4j4Xhhz3pplr; Thu, 9 Feb 2023 16:44:37 +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 4PCN4j3q38z4P0F; Thu, 9 Feb 2023 16:44:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961077; 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=B5mb/v0lRZ4Kx1+cgrtvDPkjYgisQ5lk2rV+ZIl0ctc=; b=gbU1WsIoMnqSVGyQAdTrD8nnEiLY9H8sJvNv6oBfqt2BYk1th0ssdVZQLwwg/SIFUJ5Ft1 4nJirc/CpAet97Ov5sNTluKr5qVg0ENuaIW/TA0tidYO/SKy3BYUpfu0t3tWAmR+fTceFm 23fU+0xsNVZL0rCt0RmttSYlsHdMimx3s4AjsFJ97A6ZcNvDHUQHHFMsOb++HmYaIpJ0T+ o3NypbePObbg+g562H6xeGLDz0Y4vtdIz34xRZ8j1s2ExEawIKLlXOY8NPOlGQsVRLIMmz I+1euFBIekRUkYM0KDMrwQO/Tf3eyR90KU0clIX0qxvpepRqf5kytH/Xfc0icw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675961077; 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=B5mb/v0lRZ4Kx1+cgrtvDPkjYgisQ5lk2rV+ZIl0ctc=; b=ssIa3nHjILeOkNbda5igpcuxaaUkq4+rC423rI+yraoYnIIi0G45WR96C/ZUilZSO1cdSS x/gT0vQl/u+ucNEg4lWje0WFmOYOKpgpwyG8WBkrk7PsCfdLM2n07WhRXxsLJTRqtaEZHb 5gbuzHMXmbId0RJFoFu1glpBiAm4lq8Sh5WdVOa1gp5GpQZkQaY0NFufpaTTmVk/639sOY kKU/L6jsO0bEcVANarFFRlcbn/sc0c//ZDYnPLlVplW9Fry9oJ02Bwzm8PtNXbDi+ZOyoR UwGrdO/ysRcbvIkzeUwX8LzhCpGDa8IQlet1QCItr6DnYj86DNVhhkpjhkergA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675961077; a=rsa-sha256; cv=none; b=q9gBk4ivWW8Co6AaubEnSg/QAMw/1qpVZpQqodpdx6Eh4hw/ge4iGCuJP1isUYciSaJQ/0 QW6lbo2GjdRJd4Rx0ITO6r2Onhb3QANzFj5X1QyccYgi71RLlb7jsTt81Tno/YxS4MnImb uU2hFrHZuNK7LOwJgFDeF+hJNQbgBznP1VJdIIOmjo/u3o7A7VenaC0oyMiOI/H0WGfujN bXu4JsVApOtH7T8Ux4q2HQf2qwBCBDPbu74nPMoXW5Qp9+48cq+8EJR7tsBqq9gNUUsQDL 8Am0rHz0vhZbwWGdx73pl1poEkf/KlzcrsxWf+mCCwV9eux8Vb/EY0LtLJinVA== 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 4PCN4j2rZxzkXm; Thu, 9 Feb 2023 16:44:37 +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 319Gib2C052437; Thu, 9 Feb 2023 16:44:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 319Gib1v052436; Thu, 9 Feb 2023 16:44:37 GMT (envelope-from git) Date: Thu, 9 Feb 2023 16:44:37 GMT Message-Id: <202302091644.319Gib1v052436@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 0169daa1f2cd - stable/13 - carp: turn net.inet.carp.allow into a RW tunable List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 0169daa1f2cd62394e7d068cbb405d64a8316bbc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=0169daa1f2cd62394e7d068cbb405d64a8316bbc commit 0169daa1f2cd62394e7d068cbb405d64a8316bbc Author: Boris Lytochkin AuthorDate: 2023-01-29 16:42:40 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-02-09 16:41:34 +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 (cherry picked from commit ee49c5d33d93a6b10222f64a0dc16590ac2048a0) --- 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 71558be619d8..e84a85ebc11e 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -221,8 +221,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, @@ -2238,6 +2238,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) {