Explorar o código

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>
Nicolas Dichtel %!s(int64=11) %!d(string=hai) anos
pai
achega
0d566379c5
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      include/net/genetlink.h

+ 8 - 0
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);
 	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 */