From: Evan Hunt Date: Sat, 2 Oct 2021 23:26:43 +0000 (-0700) Subject: netmgr: refactor isc__nm_incstats() and isc__nm_decstats() X-Git-Tag: v9.17.20~42^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=075139f60e2090637d94ff50c2f084c5fe0fb523;p=thirdparty%2Fbind9.git netmgr: refactor isc__nm_incstats() and isc__nm_decstats() route/netlink sockets don't have stats counters associated with them, so it's now necessary to check whether socket stats exist before incrementing or decrementing them. rather than relying on the caller for this, we now just pass the socket and an index, and the correct stats counter will be updated if it exists. --- diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index e89bd3d4852..571b064759e 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -1533,10 +1533,6 @@ isc___nmsocket_init(isc_nmsocket_t *sock, isc_nm_t *mgr, isc_nmsocket_type type, break; } - if (sock->statsindex != NULL) { - isc__nm_incstats(sock->mgr, sock->statsindex[STATID_ACTIVE]); - } - isc_mutex_init(&sock->lock); isc_condition_init(&sock->cond); isc_condition_init(&sock->scond);