chiark / gitweb /
core/socket: fix SO_REUSEPORT
authorShawn Landden <shawn@churchofgit.com>
Sat, 16 Nov 2013 21:18:13 +0000 (13:18 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 17 Nov 2013 22:41:35 +0000 (17:41 -0500)
src/core/load-fragment-gperf.gperf.m4
src/core/socket.c

index e3025d247b74c27a3b7b32f5c5fcbdeb0d81e491..b64fdc9dcba232eb8abe993e348c0c1a5f0e4796 100644 (file)
@@ -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
index f505e4f9698c3784d581ed72fb455f5c5448fe36..751f20bdcac73684095099aa8266081168b49d15 100644 (file)
@@ -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");
         }