From 20e46b673fb478fb2cb361f8b30225bf6d06a06b Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 17 Aug 2018 12:13:16 +0200 Subject: [PATCH] rec: Every thread listen on all TCP sockets without reuseport/distributes --- pdns/pdns_recursor.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index d7e2de8d1..4c768fe84 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"]); -- 2.49.0