]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
netmgr: refactor isc__nm_incstats() and isc__nm_decstats()
authorEvan Hunt <each@isc.org>
Sat, 2 Oct 2021 23:26:43 +0000 (16:26 -0700)
committerEvan Hunt <each@isc.org>
Fri, 15 Oct 2021 07:57:02 +0000 (00:57 -0700)
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.

lib/isc/netmgr/netmgr.c

index e89bd3d48526e2cfb055967bf876d0c31937ced5..571b064759e955e356a5879ca62efb28299672bc 100644 (file)
@@ -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);