Skip to content

Commit

Permalink
genetlink: add function genl_has_listeners()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas Dichtel authored and David S. Miller committed Sep 19, 2014
1 parent b3f2512 commit 0d56637
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/net/genetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 0d56637

Please sign in to comment.