]> granicus.if.org Git - pdns/commitdiff
Fix macOS build: Use IPPROTO_TCP instead of SOL_TCP
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 15 Jan 2018 19:38:42 +0000 (20:38 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Mon, 15 Jan 2018 19:38:42 +0000 (20:38 +0100)
pdns/dnsdist.cc
pdns/pdns_recursor.cc

index afd0e9d7a7e2b5d4183772287ed3ea85586e96e3..dfe52c50126c0d00187145ec08bf350a4e2de1d4 100644 (file)
@@ -2239,7 +2239,7 @@ try
 
     SSetsockopt(cs->tcpFD, SOL_SOCKET, SO_REUSEADDR, 1);
 #ifdef TCP_DEFER_ACCEPT
-    SSetsockopt(cs->tcpFD, SOL_TCP,TCP_DEFER_ACCEPT, 1);
+    SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_DEFER_ACCEPT, 1);
 #endif
     if (std::get<3>(local) > 0) {
 #ifdef TCP_FASTOPEN
@@ -2342,7 +2342,7 @@ try
     cs->tcpFD = SSocket(cs->local.sin4.sin_family, SOCK_STREAM, 0);
     SSetsockopt(cs->tcpFD, SOL_SOCKET, SO_REUSEADDR, 1);
 #ifdef TCP_DEFER_ACCEPT
-    SSetsockopt(cs->tcpFD, SOL_TCP,TCP_DEFER_ACCEPT, 1);
+    SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_DEFER_ACCEPT, 1);
 #endif
     if (std::get<3>(dcLocal) > 0) {
 #ifdef TCP_FASTOPEN
@@ -2398,11 +2398,11 @@ try
     cs->tcpFD = SSocket(cs->local.sin4.sin_family, SOCK_STREAM, 0);
     SSetsockopt(cs->tcpFD, SOL_SOCKET, SO_REUSEADDR, 1);
 #ifdef TCP_DEFER_ACCEPT
-    SSetsockopt(cs->tcpFD, SOL_TCP,TCP_DEFER_ACCEPT, 1);
+    SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_DEFER_ACCEPT, 1);
 #endif
     if (frontend->d_tcpFastOpenQueueSize > 0) {
 #ifdef TCP_FASTOPEN
-      SSetsockopt(cs->tcpFD, SOL_TCP, TCP_FASTOPEN, frontend->d_tcpFastOpenQueueSize);
+      SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_FASTOPEN, frontend->d_tcpFastOpenQueueSize);
 #else
       warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", cs->local.toStringWithPort());
 #endif
index db8084825e01f498170bacbfc2d94181293a9dc2..d96a64be9734dc6793b4bcf3966a16d5a4d411c3 100644 (file)
@@ -1917,7 +1917,7 @@ static void makeTCPServerSockets(unsigned int threadId)
     }
 
 #ifdef TCP_DEFER_ACCEPT
-    if(setsockopt(fd, SOL_TCP, TCP_DEFER_ACCEPT, &tmp, sizeof tmp) >= 0) {
+    if(setsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &tmp, sizeof tmp) >= 0) {
       if(i==locals.begin())
         L<<Logger::Error<<"Enabled TCP data-ready filter for (slight) DoS protection"<<endl;
     }