From nobody Sat Mar 18 11:45:07 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 4Pdzh41xkFz3yV6g; Sat, 18 Mar 2023 11:45:08 +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 4Pdzh40xzWz41hq; Sat, 18 Mar 2023 11:45:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139908; 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=kxKpjRUKAzxZPVvl22CLLuGAniVIbVrujotF+7R2gHs=; b=EStKqnXMFFXi4jYKiagyd5ZA750Z14JN1su0D8NK8Pq53YjRq+1RLwJVCKyd55pY/JHLiE SaMiXvgjGAB37zh/R89K1rdNjXfnNySpSGPYc/0dFOMlPkONdueimh8MoYDopmAZqhIkwI G/h7gsMADvTDMzHYhRvLvm87eZg2sU4Jzj4QcjtIeRfvvFjbIGB6ylGq7qVlkc4CYaZUg/ f4VZb1mCg61XCUtA4j4QDmbns4OQbT9WKtbKQgbXB+v1XMv11maWLSAlhc6TBfdPWJ1qHf RKdvFhND4o4tb7YD5GqaGb8EVgtRYEvMOQZIW0NuO6FtFg4Mdua5Eat2ZGg2ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679139908; 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=kxKpjRUKAzxZPVvl22CLLuGAniVIbVrujotF+7R2gHs=; b=JY4g1+h3GNmZpmJpaw58rSbJVkxfsumjeviXBzM9mErn0sCmdlQkPJDDjnqhU3g3ioLY/X XFf0xnxo6o6j9B2CjZ+NoFQGm/G4/vlyYyHqoJ3XYtedGFzR+N82ZqrFnmABHqhaEVHUmT fIMb8zAXhjNJRhaseI0e6QQkNcFOBTvIfFIs4LuwTw2Q2QjSLILbSA3NCwPLHQ+P8ac5ld 7ukboI0edyiaWJYwzkjq/Ih2ixSI4d3V6HyjGovlQlxeSyYu1WgdMrTLh+H6fKyyw8U6P4 +4gaGoCply1YEJGkF3srXOrkK6g7JqTjzjCqoFB2fG7zoIDYRJZ2Y2+kwyw6JQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679139908; a=rsa-sha256; cv=none; b=wdXYOUZ3KLutYDcYQqY+6lzRFiRzj2YgazHvSqGxDoEXvKIpnRQ/MofTxJeXHgV7eu8Q6m 4cUsKvTC5YzJI9XOySMTSku+8KViIGjtPAH+jkOhbDWfIbdHRm05Ioy4J5eLT63FXviEW5 4dL3T51QVhFTZ1d0rRjIDdA1miR6jOqY9Y1DvC/ZfIc8qB08M/llE165fBxPj/GBL6/R/4 TOATG5wv2vwTGrfi/4XSsaszgmaT1bvgkzpXKX/AJvDN4PnnEYWPsiqWlUhofeWjF/ImYH gHOA4a2HnGu1/DV6XV+gathZzs/DVm6aQheEXHS7sUNGaQ+/jzgP/+ewaY1Yyg== 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 4Pdzh370kyz15Wf; Sat, 18 Mar 2023 11:45:07 +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 32IBj7pt063513; Sat, 18 Mar 2023 11:45:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32IBj7fm063512; Sat, 18 Mar 2023 11:45:07 GMT (envelope-from git) Date: Sat, 18 Mar 2023 11:45:07 GMT Message-Id: <202303181145.32IBj7fm063512@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: 046acc2bfd13 - main - netlink: add public ucred accessor for nlp. 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/main X-Git-Reftype: branch X-Git-Commit: 046acc2bfd13f0caaf5132c1ad34877917db1a38 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=046acc2bfd13f0caaf5132c1ad34877917db1a38 commit 046acc2bfd13f0caaf5132c1ad34877917db1a38 Author: Alexander V. Chernikov AuthorDate: 2023-03-18 11:44:29 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-18 11:44:29 +0000 netlink: add public ucred accessor for nlp. MFC after: 2 weeks --- sys/netlink/netlink_ctl.h | 1 + sys/netlink/netlink_domain.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/sys/netlink/netlink_ctl.h b/sys/netlink/netlink_ctl.h index 1310a5a5493a..8cd29cf56d10 100644 --- a/sys/netlink/netlink_ctl.h +++ b/sys/netlink/netlink_ctl.h @@ -80,6 +80,7 @@ bool netlink_unregister_proto(int proto); /* Common helpers */ bool nl_has_listeners(int netlink_family, uint32_t groups_mask); bool nlp_has_priv(struct nlpcb *nlp, int priv); +struct ucred *nlp_get_cred(struct nlpcb *nlp); /* netlink_generic.c */ struct genl_cmd { diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c index 01023f7244b6..2704974173b4 100644 --- a/sys/netlink/netlink_domain.c +++ b/sys/netlink/netlink_domain.c @@ -212,6 +212,12 @@ nlp_has_priv(struct nlpcb *nlp, int priv) return (priv_check_cred(nlp->nl_cred, priv) == 0); } +struct ucred * +nlp_get_cred(struct nlpcb *nlp) +{ + return (nlp->nl_cred); +} + static uint32_t nl_find_port(void) {