diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2023-03-18 11:44:29 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2023-03-18 11:44:29 +0000 |
commit | 046acc2bfd13f0caaf5132c1ad34877917db1a38 (patch) | |
tree | 6938b0b5d76bab2c28246a609f503267289ee60e | |
parent | 568a645ba55a1c3fc4fc74735cb0fab08bfe4cbf (diff) | |
download | src-046acc2bfd13f0caaf5132c1ad34877917db1a38.tar.gz src-046acc2bfd13f0caaf5132c1ad34877917db1a38.zip |
netlink: add public ucred accessor for nlp.
MFC after: 2 weeks
-rw-r--r-- | sys/netlink/netlink_ctl.h | 1 | ||||
-rw-r--r-- | sys/netlink/netlink_domain.c | 6 |
2 files changed, 7 insertions, 0 deletions
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) { |