Subject: Re: [WTF?] random test in netlink_sendmsg()

From: Al Viro <[email-masked]>
Date: Fri, 12 Dec 2014 22:14:10 +0000

On Fri, Dec 12, 2014 at 10:50:17PM +0100, Florian Westphal wrote:

> > What do we want sendmsg(fd, &msg, 0) to do when fd is AF_NETLINK socket
> > that had setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, ...) successfully done
> > to it and msg.msg_iovlen is 0?  Userland ABI question
> 
> IIRC userland, after filling txring with at least one new netlink
> message, needs to call this to tell kernel to start processing the
> messages in the tx ring.

AFAICS, the suggested way to initiate transmission is sendto(fd, NULL, 0, ...),
not sendmsg(2).  _That_ is equivalent to msg.msg_iovlen = 1, msg.msg_iov =
&(struct iovec){NULL, 0} (and that explains the origin of the odd check,
I suppose).  The case where it goes random is different - msg.msg_iovlen = 0,
msg.msg_iov - anything, will be ignored by sys_sendmsg().