Blame SOURCES/0112-sss_sockets-pass-pointer-instead-of-integer.patch

e050a4
From 191f3722f28107ccde4ce96dd88a401fb36b059a Mon Sep 17 00:00:00 2001
e050a4
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
e050a4
Date: Mon, 10 Feb 2020 11:52:35 +0100
e050a4
Subject: [PATCH] sss_sockets: pass pointer instead of integer
e050a4
MIME-Version: 1.0
e050a4
Content-Type: text/plain; charset=UTF-8
e050a4
Content-Transfer-Encoding: 8bit
e050a4
e050a4
```
e050a4
/home/pbrezina/workspace/sssd/src/util/sss_sockets.c: In function ‘set_fd_common_opts’:
e050a4
/home/pbrezina/workspace/sssd/src/util/sss_sockets.c:123:61: error: passing argument 4 of ‘setsockopt’ makes pointer from integer without a cast [-Werror=int-conversion]
e050a4
  123 |         ret = setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, milli,
e050a4
      |                                                             ^~~~~
e050a4
      |                                                             |
e050a4
      |                                                             unsigned int
e050a4
In file included from /home/pbrezina/workspace/sssd/src/util/sss_sockets.c:28:
e050a4
/usr/include/sys/socket.h:216:22: note: expected ‘const void *’ but argument is of type ‘unsigned int’
e050a4
  216 |          const void *__optval, socklen_t __optlen) __THROW;
e050a4
      |          ~~~~~~~~~~~~^~~~~~~~
e050a4
  CC       src/util/sssd_kcm-sss_iobuf.o
e050a4
cc1: all warnings being treated as errors
e050a4
```
e050a4
e050a4
Introduced by 7aa96458f3bec4ef6ff7385107458e6b2b0b06ac
e050a4
e050a4
Reviewed-by: Sumit Bose <sbose@redhat.com>
e050a4
(cherry picked from commit 5b87af6f5b50c464ee7ea4558f73431e398e1423)
e050a4
---
e050a4
 src/util/sss_sockets.c | 2 +-
e050a4
 1 file changed, 1 insertion(+), 1 deletion(-)
e050a4
e050a4
diff --git a/src/util/sss_sockets.c b/src/util/sss_sockets.c
e050a4
index b6b6dbac5..6f2b71bc8 100644
e050a4
--- a/src/util/sss_sockets.c
e050a4
+++ b/src/util/sss_sockets.c
e050a4
@@ -120,7 +120,7 @@ static errno_t set_fd_common_opts(int fd, int timeout)
e050a4
         }
e050a4
 
e050a4
         milli = timeout * 1000; /* timeout in milliseconds */
e050a4
-        ret = setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, milli,
e050a4
+        ret = setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &milli,
e050a4
                          sizeof(milli));
e050a4
         if (ret != 0) {
e050a4
             ret = errno;
e050a4
-- 
e050a4
2.20.1
e050a4