]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Every thread listen on all TCP sockets without reuseport/distributes 6851/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 17 Aug 2018 10:13:16 +0000 (12:13 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 17 Aug 2018 10:13:16 +0000 (12:13 +0200)
pdns/pdns_recursor.cc

index d7e2de8d1bfe8d3b22264f7e8f0cb4df326b7a7f..4c768fe84c120ef320376fd117f050f7a851abb3 100644 (file)
@@ -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"]);