[CRIU] [PATCH 00/12] Support for packet's msg_name in receive queue of promiscous DGRAM sockets

Kirill Tkhai ktkhai at virtuozzo.com
Wed May 4 02:18:28 PDT 2016


On 30.04.2016 00:33, Andrew Vagin wrote:
> Hi Kirll,
> 
> We need a test for this functionality. I found static/socket_snd_addr, but it still fails.

There is a ghost dgram socket. It does not supported yet, as I wrote at [00/12]. We can to do
the second variant of the test, where all sockets remain alive.
 
> [root at fc22-vm criu]# python test/zdtm.py run -t zdtm/static/socket_snd_addr 
> === Run 1/1 ================
> 
> ===================== Run zdtm/static/socket_snd_addr in h =====================
> Start test
> ./socket_snd_addr --pidfile=socket_snd_addr.pid --outfile=socket_snd_addr.out
> Run criu dump
> Run criu restore
> Wait for zdtm/static/socket_snd_addr to die for 0.100000
> ############ Test zdtm/static/socket_snd_addr FAIL at result check #############
> Test output: ================================
> 00:32:02.203:    24: FAIL: socket_snd_addr.c:94: A sender address is mismatch (errno = 11 (Resource temporarily unavailable))
> 
>  <<< ================================
> ##################################### FAIL #####################################
> 
> 
> On Fri, Apr 29, 2016 at 05:34:52PM +0300, Kirill Tkhai wrote:
>> DGRAM packet, received using recvmsg, have msghdr populated:
>>
>> recvmsg(int sockfd, struct msghdr *msg, int flags)
>>
>> struct msghdr {
>> 	void		*msg_name;
>> 	int		msg_namelen;
>> 	...
>> };
>>
>> msg_name and msg_namelen contain the name of the sender of packet,
>> which it's bound to.
>>
>> Currently, we do not support this. We restore the whole queue with
>> the only sender (the receiver is peer for it, but there may be several
>> senders), or with empty sender.
>>
>> This series add a support for "promiscous" receive queues and restore
>> them correct.
>>
>> To do that, we determine sockets, which queue has several senders, and
>> senders, who are involved it there. Sender's fds are sent to receives,
>> and receivers restore their queues it correct order and with correct
>> msg_names.
>>
>> This patchset should have a sequel, which introduces "ghost sockets",
>> that are not supported there. Their packets are restored as having
>> noname senders now.
>>
>> ---
>>
>> Kirill Tkhai (12):
>>       unix: Link all sockets in unix_sockets list
>>       unix: Add find_unix_sk_by_name()
>>       unix: Add sender_ino of packets and socket
>>       sk-queue: Allow to dump a skb sender
>>       unix: Dump DGRAM packets and sockets senders
>>       unix: Fixup queuer of promiscuous DGRAM receivers
>>       unix: Resolve senders of packets in receive queue of DGRAM socket
>>       files: Add file_desc_ops::receive method
>>       files: Add get_unused_fd() helper
>>       unix: Send senders fds of packets in receive queue to receiver
>>       sk-queue: Allow to use several file descriptors to restore a queue
>>       unix: Add a method for choosing sender of packet in promiscous DGRAM queue
>>
>>
>>  criu/cr-restore.c       |    2 
>>  criu/files.c            |  102 +++++++++++++++
>>  criu/include/files.h    |   12 ++
>>  criu/include/image.h    |    2 
>>  criu/include/pstree.h   |    1 
>>  criu/include/sk-queue.h |   15 ++
>>  criu/sk-queue.c         |  146 ++++++++++++++++++++-
>>  criu/sk-unix.c          |  322 ++++++++++++++++++++++++++++++++++++++++++++---
>>  images/sk-packet.proto  |    1 
>>  images/sk-unix.proto    |    2 
>>  10 files changed, 567 insertions(+), 38 deletions(-)
>>
>> --
>> Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
>> _______________________________________________
>> CRIU mailing list
>> CRIU at openvz.org
>> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list