git: 578fa16e10ee - stable/13 - netlink: add public ucred accessor for nlp.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 08 Apr 2023 19:44:56 UTC
The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=578fa16e10eec233c01f1c8d88dd450c4e72330c commit 578fa16e10eec233c01f1c8d88dd450c4e72330c Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2023-03-18 11:44:29 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2023-04-08 19:13:05 +0000 netlink: add public ucred accessor for nlp. MFC after: 2 weeks (cherry picked from commit 046acc2bfd13f0caaf5132c1ad34877917db1a38) --- 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 348788434175..89de379c2e5d 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) {