From nobody Sun Aug 21 14:45:39 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M9dZr1S34z4YyBV; Sun, 21 Aug 2022 14:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M9dZr0t1Pz4Lp6; Sun, 21 Aug 2022 14:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661093140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N8xa1vDiC4k7COLXtrF+p7ZvzhX1bZQhoXFybHBtoz4=; b=v20nhwQyzO4DNduIIwbwdaWlQUabdqlTZjFCoxludFxdwnZUE1i/mEZQfPJg/rYcHkejm3 0QRpj8UQ01x5sSpP0UY1l/eEfVvzqrdknGyuskzlbztjIudhNyos7AYAw2Oo3nt5ZG3WyX yLOeKq0Ff+J2rhfQ8vF2VF6X8Zqsq0DEGqbMozlaCdXbOYT2bNNHccjwzDMADw2ytzsM1w A7kdRiVdlL28nmKhyNIrAl5USVy4xFnMtL4vUbi1houtDf4NP6geqVvMkAFqXFzQ56ZjLy TXPDVMftk2lCH/m2Hgz5eUdPHDw78RN3CZ6Ou1IvskxQ98gqurUJjm0scUZipQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M9dZq70wnzDm8; Sun, 21 Aug 2022 14:45:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27LEjdfZ085140; Sun, 21 Aug 2022 14:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27LEjdiE085139; Sun, 21 Aug 2022 14:45:39 GMT (envelope-from git) Date: Sun, 21 Aug 2022 14:45:39 GMT Message-Id: <202208211445.27LEjdiE085139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9d5481242127 - main - snmp_mibII: use net.inet.ip.fragttl sysctl for ipReasmTimeout List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d54812421274e490dc5f0fe4722ab8d35d9b258 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661093140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N8xa1vDiC4k7COLXtrF+p7ZvzhX1bZQhoXFybHBtoz4=; b=o1IfiGuUk/rZRfRjOOqsLeSVqIHU2Yiu/lTteoomd96byJ7h80PmH7h9gtiOGfSHDYwm1/ 96AH/UJXKJyNTic1xBHZsoAqLx7qyHj6Rc3g8R3xyDd6iuBo2cK/HjIVqlnn1yPhkvH14L jP6eblMBCsluX9H43v6gA2xHHD4WiwCnf99BK6KlmjXko89P8vRnnTcohfbV7Oi6fbqN1P Ye1CbBH0lm3lwWbxJB+FrfiA2tdMBpvwMCh0RhA0Ch1AvTb7Hmd72r4qYkjvKfy7ZfMMuH WmJxr2BMZtpRqyxO6Cdzt6iL3xQI0Q24+H3IWErGMZg9fQYEM9rPL+g2tfbw7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661093140; a=rsa-sha256; cv=none; b=TJ0TY1lOfAZ2CQkPws4xIR9Ha+x22MffGfd3OZ09WKWOdn97/+froRpDYwM9D7ZkKRooqb enCv4rHoid4me4xUusOra8MWZvB37ul4GHND7UeM5KSk0H6gUZ4H5Q+7729Ag9QEqfnuYe /g4otT9xpUtv/0aN+1oGcCOcy2xvnnpu+gxE4ACSlPSeJ+MWG5uoS2Zz6+WZoZpRUmadXC mj9kvnU5SYTXCoqHJ2rBD4M1+Y2cettTUg04WceU7/D3C+dYKwp9D5OnwkD1J5qIRkEEPh u/NlDbzanUJYljNzs91X6bYQdnk34vAV5Ni5mWQyhFdVCqbXp3KczWlkE09hYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9d54812421274e490dc5f0fe4722ab8d35d9b258 commit 9d54812421274e490dc5f0fe4722ab8d35d9b258 Author: Gleb Smirnoff AuthorDate: 2022-08-21 14:44:58 +0000 Commit: Gleb Smirnoff CommitDate: 2022-08-21 14:44:58 +0000 snmp_mibII: use net.inet.ip.fragttl sysctl for ipReasmTimeout Using IPFRAGTTL define was never correct, as it was measured in PR_SLOWTIMO intervals. The sysctl returns seconds, just what ipReasmTimeout is. --- contrib/bsnmp/snmp_mibII/mibII_ip.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/contrib/bsnmp/snmp_mibII/mibII_ip.c b/contrib/bsnmp/snmp_mibII/mibII_ip.c index 8290eebbc6f0..6a59a5b8e388 100644 --- a/contrib/bsnmp/snmp_mibII/mibII_ip.c +++ b/contrib/bsnmp/snmp_mibII/mibII_ip.c @@ -44,6 +44,7 @@ static struct icmpstat icmpstat; static int ip_forwarding; static int ip_defttl; +static u_int ip_fragttl; static uint64_t ip_tick; static uint64_t ipstat_tick; @@ -79,6 +80,17 @@ fetch_ipstat(void) return (-1); } + len = sizeof(ip_fragttl); + if (sysctlbyname("net.inet.ip.fragttl", &ip_fragttl, &len, + NULL, 0) == -1) { + syslog(LOG_ERR, "net.inet.ip.fragttl: %m"); + return (-1); + } + if (len != sizeof(ip_fragttl)) { + syslog(LOG_ERR, "net.inet.ip.fragttl: wrong size"); + return (-1); + } + ipstat_tick = get_ticks(); return (0); } @@ -309,7 +321,7 @@ op_ipstat(struct snmp_context *ctx __unused, struct snmp_value *value, break; case LEAF_ipReasmTimeout: - value->v.integer = IPFRAGTTL; + value->v.integer = ip_fragttl; break; case LEAF_ipReasmReqds: