netlink: add public ucred accessor for nlp.

MFC after:	2 weeks
This commit is contained in:
Alexander V. Chernikov 2023-03-18 11:44:29 +00:00
parent 568a645ba5
commit 046acc2bfd
2 changed files with 7 additions and 0 deletions

View File

@ -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 {

View File

@ -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)
{