chiark / gitweb /
socket: Set SO_REUSEPORT before bind()
authorChristos Trochalakis <yatiohi@ideopolis.gr>
Wed, 1 Jul 2015 11:39:53 +0000 (14:39 +0300)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:05:54 +0000 (10:05 +0100)
commit2054442fa4eaef0d904bcbbe1b98f57386ceb87d
tree1531c21ae6a5ab450bc80586f9ad442b7b48b361
parent322e286bc4da19f8dcfe991971e397e0afca067b
socket: Set SO_REUSEPORT before bind()

bind() fails if it is called before setting SO_REUSEPORT and another
process is already binded to the same addess.

A new reuse_port option has been introduced to socket_address_listen()
to set the option as part of socket initialization.
src/shared/socket-label.c
src/shared/socket-util.h