diff options
author | Patrick McHardy <kaber@trash.net> | 2006-03-20 21:52:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-20 21:52:01 -0500 |
commit | 4277a083ecd2c8771058641132bcecea04ca6608 (patch) | |
tree | c35d659c63fa4d64e2569e5eebd76e1b3fba9a15 /include/linux/netlink.h | |
parent | a24276924875802853b5bdc12c56d29f1c1bbc79 (diff) |
[NETLINK]: Add netlink_has_listeners for avoiding unneccessary event message generation
Keep a bitmask of multicast groups with subscribed listeners to let
netlink users check for listeners before generating multicast
messages.
Queries don't perform any locking, which may result in false
positives, it is guaranteed however that any new subscriptions are
visible before bind() or setsockopt() return.
Signed-off-by: Patrick McHardy <kaber@trash.net>
ACKed-by: Jamal Hadi Salim<hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r-- | include/linux/netlink.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index c256ebe2a7b4..f8f3d1c927f8 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -151,6 +151,7 @@ struct netlink_skb_parms | |||
151 | 151 | ||
152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); | 152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); |
153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
154 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | ||
154 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 155 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
155 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 156 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
156 | __u32 group, gfp_t allocation); | 157 | __u32 group, gfp_t allocation); |