mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 08:31:55 +00:00
genetlink: add function genl_has_listeners()
This function is the counterpart of the function netlink_has_listeners(). Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b3f2512ecd
commit
0d566379c5
@ -394,4 +394,12 @@ static inline int genl_set_err(struct genl_family *family, struct net *net,
|
||||
return netlink_set_err(net->genl_sock, portid, group, code);
|
||||
}
|
||||
|
||||
static inline int genl_has_listeners(struct genl_family *family,
|
||||
struct sock *sk, unsigned int group)
|
||||
{
|
||||
if (WARN_ON_ONCE(group >= family->n_mcgrps))
|
||||
return -EINVAL;
|
||||
group = family->mcgrp_offset + group;
|
||||
return netlink_has_listeners(sk, group);
|
||||
}
|
||||
#endif /* __NET_GENERIC_NETLINK_H */
|
||||
|
Loading…
Reference in New Issue
Block a user