]> granicus.if.org Git - pdns/commitdiff
dnsdist: Use portable IPPROTO_TCP instead of SOL_TCP for TCP_FASTOPEN
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 5 Oct 2016 08:38:04 +0000 (10:38 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 5 Oct 2016 13:25:18 +0000 (15:25 +0200)
This fixes the compilation on FreeBSD, where IPPROTO_TCP and
TCP_FASTOPEN are defined but SOL_TCP isn't.

pdns/dnsdist.cc

index 847cdcacf3ef0b4fea1ba5e9cae5c2ab6759702e..16e95957d27bc2a65aa8d89c1f5a1feff4114ce6 100644 (file)
@@ -1760,7 +1760,7 @@ try
 #endif
     if (std::get<3>(local) > 0) {
 #ifdef TCP_FASTOPEN
-      SSetsockopt(cs->tcpFD, SOL_TCP, TCP_FASTOPEN, std::get<3>(local));
+      SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_FASTOPEN, std::get<3>(local));
 #else
       warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", std::get<0>(local).toStringWithPort());
 #endif
@@ -1837,7 +1837,7 @@ try
 #endif
     if (std::get<3>(dcLocal) > 0) {
 #ifdef TCP_FASTOPEN
-      SSetsockopt(cs->tcpFD, SOL_TCP, TCP_FASTOPEN, std::get<3>(dcLocal));
+      SSetsockopt(cs->tcpFD, IPPROTO_TCP, TCP_FASTOPEN, std::get<3>(dcLocal));
 #else
       warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", std::get<0>(dcLocal).toStringWithPort());
 #endif