>From 090ffbdeb49b352dcbd97c8737c9f117b459ddf8 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Sat, 31 May 2014 18:33:40 +0200 Subject: [PATCH] SDAP: Use portable constant as level in setsockopt The macros SOL_TCP and IPPROTO_TCP have the same value on linux, but the first one is not portable. man in.h says: The header shall define the following macros for use as values of the level argument of getsockopt() and setsockopt(): IPPROTO_IP Internet protocol. IPPROTO_IPV6 Internet Protocol Version 6. IPPROTO_ICMP Control message protocol. IPPROTO_RAW Raw IP Packets Protocol. IPPROTO_TCP Transmission control protocol. IPPROTO_UDP User datagram protocol. --- src/util/sss_ldap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index a2101ecde4497c2045e2adb035eb33e2f790aca1..dd63b4b4f22f0aa1b540bc04ede211ac9cb88ebe 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -270,7 +270,7 @@ static errno_t set_fd_flags_and_opts(int fd) strerror(ret)); } - ret = setsockopt(fd, SOL_TCP, TCP_NODELAY, &dummy, sizeof(dummy)); + ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &dummy, sizeof(dummy)); if (ret != 0) { ret = errno; DEBUG(SSSDBG_FUNC_DATA, -- 1.9.3