anitazha / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone

Blame SOURCES/0242-socket-fix-setsockopt-call.-SOL_SOCKET-changed-to-SO.patch

803fb7
From a905a1904792b4d5992add15a5cf396b581c1e36 Mon Sep 17 00:00:00 2001
803fb7
From: Robin Hack <rhack@redhat.com>
803fb7
Date: Mon, 31 Aug 2015 11:45:09 +0200
803fb7
Subject: [PATCH] socket: fix setsockopt call. SOL_SOCKET changed to SOL_TCP.
803fb7
803fb7
Cherry-picked from: 172cfe8714754e1f16fc500e3ed02c4de68de92
803fb7
Resolves: #1135599
803fb7
---
803fb7
 src/core/socket.c | 2 +-
803fb7
 1 file changed, 1 insertion(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/core/socket.c b/src/core/socket.c
803fb7
index 760de0203..7022e77b5 100644
803fb7
--- a/src/core/socket.c
803fb7
+++ b/src/core/socket.c
803fb7
@@ -833,7 +833,7 @@ static void socket_apply_socket_options(Socket *s, int fd) {
803fb7
 
803fb7
         if (s->keep_alive_cnt) {
803fb7
                 int value = s->keep_alive_cnt;
803fb7
-                if (setsockopt(fd, SOL_SOCKET, TCP_KEEPCNT, &value, sizeof(value)) < 0)
803fb7
+                if (setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &value, sizeof(value)) < 0)
803fb7
                         log_unit_warning(UNIT(s)->id, "TCP_KEEPCNT failed: %m");
803fb7
         }
803fb7