From: Remi Gacogne Date: Mon, 3 Jul 2017 10:59:33 +0000 (+0200) Subject: rec: Fix all work threads listening on all 'per thread' sockets X-Git-Tag: rec-4.1.0-alpha1~31^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5487%2Fhead;p=thirdparty%2Fpdns.git rec: Fix all work threads listening on all 'per thread' sockets --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 2220f192c8..557320d381 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1952,7 +1952,7 @@ static void makeUDPServerSockets(unsigned int threadId) sin.sin4.sin_port = htons(st.port); -#ifdef SO_REUSEPORT +#ifdef SO_REUSEPORT if(g_reusePort) { if(setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &one, sizeof(one)) < 0) throw PDNSException("SO_REUSEPORT: "+stringerror()); @@ -3013,10 +3013,8 @@ try t_fdm->addReadFD(g_pipes[t_id].readToThread, handlePipeRequest); if(g_useOneSocketPerThread) { - for (unsigned int threadId = 0; threadId < g_numWorkerThreads; threadId++) { - for(deferredAdd_t::const_iterator i = deferredAdds[threadId].cbegin(); i != deferredAdds[threadId].cend(); ++i) { - t_fdm->addReadFD(i->first, i->second); - } + for(deferredAdd_t::const_iterator i = deferredAdds[t_id].cbegin(); i != deferredAdds[t_id].cend(); ++i) { + t_fdm->addReadFD(i->first, i->second); } } else {