core/socket: fix SO_REUSEPORT
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
e55001ebba
commit
f0511bd7e3
@@ -210,6 +210,7 @@ Socket.Broadcast, config_parse_bool, 0,
|
||||
Socket.PassCredentials, config_parse_bool, 0, offsetof(Socket, pass_cred)
|
||||
Socket.PassSecurity, config_parse_bool, 0, offsetof(Socket, pass_sec)
|
||||
Socket.TCPCongestion, config_parse_string, 0, offsetof(Socket, tcp_congestion)
|
||||
Socket.ReusePort, config_parse_bool, 0, offsetof(Socket, reuseport)
|
||||
Socket.MessageQueueMaxMessages, config_parse_long, 0, offsetof(Socket, mq_maxmsg)
|
||||
Socket.MessageQueueMessageSize, config_parse_long, 0, offsetof(Socket, mq_msgsize)
|
||||
Socket.Service, config_parse_socket_service, 0, 0
|
||||
|
||||
+1
-1
@@ -771,7 +771,7 @@ static void socket_apply_socket_options(Socket *s, int fd) {
|
||||
|
||||
if (s->reuseport) {
|
||||
int b = s->reuseport;
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &b, sizeof(b)))
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &b, sizeof(b)) < 0)
|
||||
log_warning_unit(UNIT(s)->id, "SO_REUSEPORT failed: %m");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user