* Evgeniy Polyakov <[EMAIL PROTECTED]> 2005-07-29 14:45
> Subscription is a netlink socket option, which, if enabled, ends up
> in direct message delivering, but not multicast one.

I don't get this, you introduce a new option which basically
changes the subscription schema from a bitmask to a single
identifier. I don't see any code which would prevent the
message delivery if the bitmask actually matches an identifier.

> +static int netlink_is_bound(struct sock *sk, u32 pid) 
> +{
> +     struct nl_pid_hash *hash = &nl_table[sk->sk_protocol].hash;
> +     struct hlist_head *head;
> +     struct sock *osk;
> +     struct hlist_node *node;
> +     int bound = 0;
> +
> +     head = nl_pid_hashfn(hash, pid);
> +     sk_for_each(osk, node, head) {
> +             if (nlk_sk(osk)->pid == pid) {
> +                     bound = 1;
> +                     break;
> +             }
> +     }
> +
> +     return bound;
> +}

It's actually obvious but it might be worth to add a comment
to this funtion that at least a read lock on nl_table_lock
must be held.
-
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

Reply via email to