Skip to content

Commit 0d56637

Browse files
NicolasDichteldavem330
authored andcommitted
genetlink: add function genl_has_listeners()
This function is the counterpart of the function netlink_has_listeners(). Signed-off-by: Nicolas Dichtel <[email protected]> Acked-by: Pravin B Shelar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b3f2512 commit 0d56637

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/net/genetlink.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,4 +394,12 @@ static inline int genl_set_err(struct genl_family *family, struct net *net,
394394
return netlink_set_err(net->genl_sock, portid, group, code);
395395
}
396396

397+
static inline int genl_has_listeners(struct genl_family *family,
398+
struct sock *sk, unsigned int group)
399+
{
400+
if (WARN_ON_ONCE(group >= family->n_mcgrps))
401+
return -EINVAL;
402+
group = family->mcgrp_offset + group;
403+
return netlink_has_listeners(sk, group);
404+
}
397405
#endif /* __NET_GENERIC_NETLINK_H */

0 commit comments

Comments
 (0)