From: Remi Gacogne Date: Fri, 17 Aug 2018 10:13:16 +0000 (+0200) Subject: rec: Every thread listen on all TCP sockets without reuseport/distributes X-Git-Tag: rec-4.1.4~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6851%2Fhead;p=thirdparty%2Fpdns.git rec: Every thread listen on all TCP sockets without reuseport/distributes --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d7e2de8d1b..4c768fe84c 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3102,6 +3102,14 @@ static int serviceMain(int argc, char*argv[]) else { makeUDPServerSockets(0); makeTCPServerSockets(0); + + if (!g_weDistributeQueries) { + /* we are not distributing queries and we don't have reuseport, + so every thread will be listening on all the TCP sockets */ + for (unsigned int threadId = 1; threadId < g_numWorkerThreads; threadId++) { + g_tcpListenSockets[threadId] = g_tcpListenSockets[0]; + } + } } SyncRes::parseEDNSSubnetWhitelist(::arg()["edns-subnet-whitelist"]);