From 92bbc9914c6f93edca8fb1444278c919a9c5c04c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 2 Nov 2017 10:42:42 +1100 Subject: [PATCH] 4805. [bug] TCP4Active and TCP6Active weren't being updated correctly. [RT #46454] --- CHANGES | 3 +++ lib/isc/unix/socket.c | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index aa331726a6..5430b32b29 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4805. [bug] TCP4Active and TCP6Active weren't being updated + correctly. [RT #46454] + 4804. [port] win32: access() does not work on directories as required by POSIX. Supply a alternative in isc_file_isdirwritable. [RT #46394] diff --git a/lib/isc/unix/socket.c b/lib/isc/unix/socket.c index 5062c38584..2bf3e08a0f 100644 --- a/lib/isc/unix/socket.c +++ b/lib/isc/unix/socket.c @@ -3724,6 +3724,12 @@ internal_accept(isc_task_t *me, isc_event_t *ev) { */ dev->address = NEWCONNSOCK(dev)->peer_address; + if (NEWCONNSOCK(dev)->active == 0) { + inc_stats(manager->stats, + NEWCONNSOCK(dev)->statsindex[STATID_ACTIVE]); + NEWCONNSOCK(dev)->active = 1; + } + LOCK(&manager->fdlock[lockid]); manager->fds[fd] = NEWCONNSOCK(dev); manager->fdstate[fd] = MANAGED; @@ -3749,7 +3755,6 @@ internal_accept(isc_task_t *me, isc_event_t *ev) { UNLOCK(&manager->lock); inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]); - inc_stats(manager->stats, sock->statsindex[STATID_ACTIVE]); } else { inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]); NEWCONNSOCK(dev)->references--;