> > + /* Don't bother queuing skb if kernel socket has no input function */
> > + if (nlk->pid == 0 && !nlk->data_ready)
> > + goto no_dst;
> > +
>
> Oops, turns out this doesn't work. data_ready is never NULL, look at
> how netlink_kernel_create() works.
It's ok: sk->data_ready is never null, but nlk_sk(sk)->data_ready will be
null unless an input function is provided there.
> Also, the broadcast case probably needs to be handled
> too?
Netlink sockets created by netlink_kernel_create() do not subscribe to any
groups and are not broadcast to.
> As an aside, to be honest what's so wrong with the socket receive
> buffer filling up? The damage is limited to the receive buffer size
> of the kernel netlink socket, but that's it.
Agreed, it's not really harmful, but it's sloppy. Better to let the
application know that it can't send to the socket rather than let it keep
sending (with successful return codes) until the kernel socket buffer
fills up.
- James
-- James Morris <jmorris@intercode.com.au>- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/