Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 */