• 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
..
Makefile Loading commit data...
core.proto Loading commit data...
creds.proto Loading commit data...
eventfd.proto Loading commit data...
eventpoll.proto Loading commit data...
fdinfo.proto Loading commit data...
fh.proto Loading commit data...
fifo.proto Loading commit data...
fown.proto Loading commit data...
fs.proto Loading commit data...
ghost-file.proto Loading commit data...
inotify.proto Loading commit data...
inventory.proto Loading commit data...
ipc-desc.proto Loading commit data...
ipc-msg.proto Loading commit data...
ipc-sem.proto Loading commit data...
ipc-shm.proto Loading commit data...
ipc-var.proto Loading commit data...
itimer.proto Loading commit data...
mm.proto Loading commit data...
mnt.proto Loading commit data...
netdev.proto Loading commit data...
packet-sock.proto Loading commit data...
pipe-data.proto Loading commit data...
pipe.proto Loading commit data...
pstree.proto Loading commit data...
regfile.proto Loading commit data...
remap-file-path.proto Loading commit data...
sa.proto Loading commit data...
signalfd.proto Loading commit data...
sk-inet.proto Loading commit data...
sk-opts.proto Loading commit data...
sk-packet.proto Loading commit data...
sk-unix.proto Loading commit data...
tcp-stream.proto Loading commit data...
utsns.proto Loading commit data...
vma.proto Loading commit data...