On Mon, Jan 30, 2006 at 07:58:17PM +0100, Patrick McHardy wrote: > This is the patch for checking for netlink multicast listeners. > > Jamal, does this fit your needs?
> [NETLINK]: Add netlink_has_listeners() for checking for multicast listeners > > Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]> > > @@ -806,6 +829,17 @@ retry: > return netlink_sendskb(sk, skb, ssk->sk_protocol); > } > > +int netlink_has_listeners(struct sock *sk, unsigned int group) > +{ > + int res = 0; > + > + read_lock(&nl_table_lock); > + if (group - 1 < nl_table[sk->sk_protocol].groups) > + res = test_bit(group - 1, nl_table[sk->sk_protocol].listeners); > + read_unlock(&nl_table_lock); > + return res; > +} > + Unfortunately this is a bit too heavy weight. He needs it on the packet rx/tx path. Perhaps RCU would help? Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html