summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/server.c
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2015-12-11 12:28:50 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2015-12-11 12:28:50 +0000
commitbfeff489804ae07cbd2e83bfe3c3e29b9f213618 (patch)
treea3215c9ae76d03bcfd08d1b53f1b923e28ad0d08 /usr.sbin/nsd/server.c
parent0acd6a362b41e985e864a92e9bee8ab3fbd9adf2 (diff)
update to NSD 4.1.7, ok florian@
Diffstat (limited to 'usr.sbin/nsd/server.c')
-rw-r--r--usr.sbin/nsd/server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/nsd/server.c b/usr.sbin/nsd/server.c
index 13093165098..2b3be10618f 100644
--- a/usr.sbin/nsd/server.c
+++ b/usr.sbin/nsd/server.c
@@ -760,6 +760,11 @@ server_init_ifs(struct nsd *nsd, size_t from, size_t to, int* reuseport_works)
continue;
}
nsd->tcp[i].fam = (int)addr->ai_family;
+ /* turn off REUSEPORT for TCP by copying the socket fd */
+ if(i >= nsd->ifs) {
+ nsd->tcp[i].s = nsd->tcp[i%nsd->ifs].s;
+ continue;
+ }
if ((nsd->tcp[i].s = socket(addr->ai_family, addr->ai_socktype, 0)) == -1) {
#if defined(INET6)
if (addr->ai_family == AF_INET6 &&