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

Kirill Tkhai ktkhai at virtuozzo.com
Fri May 27 06:05:30 PDT 2016


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 the sender is 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 support for "promiscous"
receive queues and restore them correct.

To do that, we determine sockets, which queues have several senders, and
senders, who are involved there. Sender's fds are sent to receives,
and receivers restore their queues it correct order and with correct
msg_names.

This patchset ill have a sequel, which introduces "ghost sockets",
that are not supported there. Their packets are restored as having
noname senders now.

v2: restore_promisc_queue(): preserve foreign sockets names
    Use find_used_fd() instead of doing new realization
    Add test socket_snd_addr01
    Refactoring

---

Kirill Tkhai (15):
      files: Fix find_unused_fd() overflow
      files: Implement find_used_fd()
      pstree: Export current
      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
      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
      zdtm: Add socket_snd_addr01 test


 criu/cr-restore.c                    |    2 
 criu/files.c                         |   47 +++++
 criu/include/files.h                 |   19 +-
 criu/include/pstree.h                |    2 
 criu/include/sk-queue.h              |   28 +++
 criu/sk-queue.c                      |  146 +++++++++++++--
 criu/sk-unix.c                       |  335 ++++++++++++++++++++++++++++++++--
 images/sk-packet.proto               |    1 
 images/sk-unix.proto                 |    2 
 test/zdtm/static/Makefile            |    1 
 test/zdtm/static/socket_snd_addr01.c |  166 +++++++++++++++++
 11 files changed, 706 insertions(+), 43 deletions(-)
 create mode 100644 test/zdtm/static/socket_snd_addr01.c

--
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>


More information about the CRIU mailing list