From: Otto Moerbeek Date: Mon, 26 Sep 2022 14:28:46 +0000 (+0200) Subject: Properly guard TCP_DEFER_ACCEPT X-Git-Tag: rec-4.9.0-alpha0~32^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12021%2Fhead;p=thirdparty%2Fpdns.git Properly guard TCP_DEFER_ACCEPT --- diff --git a/pdns/recursordist/rec-tcp.cc b/pdns/recursordist/rec-tcp.cc index be9a3a6670..975389a766 100644 --- a/pdns/recursordist/rec-tcp.cc +++ b/pdns/recursordist/rec-tcp.cc @@ -1035,7 +1035,9 @@ void makeTCPServerSockets(deferredAdd_t& deferredAdds, std::set& 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& 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 } }