• Andrey Vagin's avatar
    sk-inet: restore option REUSEADDR (v2) · a74605a7
    Andrey Vagin authored
    All sockets are created with SO_REUSEADDR, it's needed for restoring.
    E.g.: A listen socket is created after a connected socket. Both of them
    are binded to one port.
    
    So SO_REUSEADDR should be restored, when all sockets on a port were created.
    
    This code creates a structure for each port of one type of sockets
    and accounts a number of sockets, which are not restored yet.
    
    Sockets have a hook post_open(), in which it waits when all sockets for
    a defined port would be created and then it will restore SO_REUSEADDR.
    
    struct port contains a type (udp, tcp, etc) and a port number.
    It doesn't contain family or addr, because it's extra loads of logic,
    which doesn't bring a significant profits.
    
    v2: fix according with comments from Pavel
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    a74605a7
Name
Last commit
Last update
Documentation Loading commit data...
include Loading commit data...
protobuf Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Makefile Loading commit data...
Makefile.inc Loading commit data...
Makefile.pie Loading commit data...
Makefile.syscall Loading commit data...
README Loading commit data...
cr-check.c Loading commit data...
cr-dump.c Loading commit data...
cr-restore.c Loading commit data...
cr-show.c Loading commit data...
crtools.c Loading commit data...
eventfd.c Loading commit data...
eventpoll.c Loading commit data...
fifo.c Loading commit data...
file-ids.c Loading commit data...
files-reg.c Loading commit data...
files.c Loading commit data...
gen-offsets.sh Loading commit data...
image.c Loading commit data...
inotify.c Loading commit data...
ipc_ns.c Loading commit data...
kcmp-ids.c Loading commit data...
libnetlink.c Loading commit data...
log.c Loading commit data...
mount.c Loading commit data...
namespaces.c Loading commit data...
net.c Loading commit data...
netfilter.c Loading commit data...
parasite-head-x86-64.S Loading commit data...
parasite-syscall.c Loading commit data...
parasite.c Loading commit data...
pie.lds.S Loading commit data...
pipes.c Loading commit data...
proc_parse.c Loading commit data...
protobuf.c Loading commit data...
pstree.c Loading commit data...
ptrace.c Loading commit data...
rbtree.c Loading commit data...
restorer-log.c Loading commit data...
restorer.c Loading commit data...
shmem.c Loading commit data...
signalfd.c Loading commit data...
sk-inet.c Loading commit data...
sk-packet.c Loading commit data...
sk-queue.c Loading commit data...
sk-tcp.c Loading commit data...
sk-unix.c Loading commit data...
sockets.c Loading commit data...
syscall-common-x86-64.S Loading commit data...
syscalls-x86-64.sh Loading commit data...
sysctl.c Loading commit data...
util-net.c Loading commit data...
util.c Loading commit data...
uts_ns.c Loading commit data...