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

Andrew Vagin avagin at virtuozzo.com
Fri Apr 29 08:13:14 PDT 2016


https://travis-ci.org/criupatchwork/criu/builds/126673004

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