summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index 2def0c9ead..cf88bae9da 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -536,6 +536,11 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
"%sMessageQueueMessageSize: %li\n",
prefix, s->mq_msgsize);
+ if (s->reuseport)
+ fprintf(f,
+ "%sReusePort: %s\n",
+ prefix, yes_no(s->reuseport));
+
if (s->smack)
fprintf(f,
"%sSmackLabel: %s\n",
@@ -792,6 +797,12 @@ static void socket_apply_socket_options(Socket *s, int fd) {
if (setsockopt(fd, SOL_TCP, TCP_CONGESTION, s->tcp_congestion, strlen(s->tcp_congestion)+1) < 0)
log_warning_unit(UNIT(s)->id, "TCP_CONGESTION failed: %m");
+ if (s->reuseport) {
+ int b = s->reuseport;
+ if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &b, sizeof(b)))
+ log_warning_unit(UNIT(s)->id, "SO_REUSEPORT failed: %m");
+ }
+
#ifdef HAVE_SMACK
if (s->smack_ip_in)
if (fsetxattr(fd, "security.SMACK64IPIN", s->smack_ip_in, strlen(s->smack_ip_in), 0) < 0)