Commit 0d566379 authored by Nicolas Dichtel's avatar Nicolas Dichtel Committed by David S. Miller

genetlink: add function genl_has_listeners()

This function is the counterpart of the function netlink_has_listeners().
Signed-off-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: default avatarPravin B Shelar <pshelar@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3f2512e
...@@ -394,4 +394,12 @@ static inline int genl_set_err(struct genl_family *family, struct net *net, ...@@ -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); 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 */ #endif /* __NET_GENERIC_NETLINK_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment