summaryrefslogtreecommitdiffstats
path: root/include/net/genetlink.h
diff options
context:
space:
mode:
authorNicolas Dichtel <nicolas.dichtel@6wind.com>2014-09-18 10:31:03 +0200
committerDavid S. Miller <davem@davemloft.net>2014-09-19 17:28:26 -0400
commit0d566379c5e15a2922dc6bb2ee6a4b7f7a3a0786 (patch)
treebef23893af7ea3384dc1787c3ef536c1b33d7845 /include/net/genetlink.h
parentb3f2512ecdb3561ffa44737f370fdb78e1febf6b (diff)
downloadop-kernel-dev-0d566379c5e15a2922dc6bb2ee6a4b7f7a3a0786.zip
op-kernel-dev-0d566379c5e15a2922dc6bb2ee6a4b7f7a3a0786.tar.gz
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>
Diffstat (limited to 'include/net/genetlink.h')
-rw-r--r--include/net/genetlink.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 93695f0..af10c2c 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -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 */
OpenPOWER on IntegriCloud