]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Properly guard TCP_DEFER_ACCEPT 12021/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 26 Sep 2022 14:28:46 +0000 (16:28 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 26 Sep 2022 14:31:38 +0000 (16:31 +0200)
pdns/recursordist/rec-tcp.cc

index be9a3a667036f78d9e60879d35089c334a82326e..975389a7664ed76fb9bc3365e2b5566c59ecb1a5 100644 (file)
@@ -1035,7 +1035,9 @@ void makeTCPServerSockets(deferredAdd_t& deferredAdds, std::set<int>& tcpSockets
     throw PDNSException("No local address specified");
   }
 
+#ifdef TCP_DEFER_ACCEPT
   auto first = true;
+#endif
   const uint16_t defaultLocalPort = ::arg().asNum("local-port");
   for (const auto& localAddress : localAddresses) {
     ComboAddress address{localAddress, defaultLocalPort};
@@ -1127,6 +1129,8 @@ void makeTCPServerSockets(deferredAdd_t& deferredAdds, std::set<int>& tcpSockets
     SLOG(g_log << Logger::Info << "Listening for TCP queries on " << address.toStringWithPort() << endl,
          log->info(Logr::Info, "Listening for queries", "protocol", Logging::Loggable("TCP"), "address", Logging::Loggable(address)));
 
+#ifdef TCP_DEFER_ACCEPT
     first = false;
+#endif
   }
 }