]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Add conditional compilation
authorY7n05h <Y7n05h@protonmail.com>
Sun, 3 Apr 2022 07:43:25 +0000 (15:43 +0800)
committerY7n05h <Y7n05h@protonmail.com>
Sun, 3 Apr 2022 07:43:25 +0000 (15:43 +0800)
Signed-off-by: Y7n05h <Y7n05h@protonmail.com>
pdns/dnsdist.cc

index bf98eb12866bd9f70e500318230b3b95a3d22f51..5ac0cccf6d12209e381e67e6a9a63f4465c77adc 100644 (file)
@@ -1983,11 +1983,13 @@ static void setUpLocalBind(std::unique_ptr<ClientState>& cs)
     if (cs->fastOpenQueueSize > 0) {
 #ifdef TCP_FASTOPEN
       SSetsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, cs->fastOpenQueueSize);
+#ifdef TCP_FASTOPEN_KEY
       if (!g_TCPFastOpenKey.empty()) {
         auto res = setsockopt(fd, IPPROTO_IP, TCP_FASTOPEN_KEY, g_TCPFastOpenKey.data(), g_TCPFastOpenKey.size() * sizeof(g_TCPFastOpenKey[0]));
         if (res == -1)
           throw runtime_error("setsockopt for level IPPROTO_TCP and opname TCP_FASTOPEN_KEY failed: " + stringerror());
       }
+#endif
 #else
       if (warn) {
         warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", cs->local.toStringWithPort());