From nobody Thu Dec 18 13:45:27 2025 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 4dXBkb3ZQCz6KxlG for ; Thu, 18 Dec 2025 13:45:27 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXBkb2vSGz3Msr for ; Thu, 18 Dec 2025 13:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766065527; 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=UcTF5XW0XGa68VbIgixiF5iSC3nINwLU67IyQh//eIU=; b=k5lQcZnaibDe+K357kdiBc41SFGwA6SikwlM+SXgJg6S57YbgmLuY9ut5tXQkXb1lOgwJx gTKWza2iX9bLlQR4v3hKP7TeMP53RE7haumvJHVwlEdjqanZYJzZ5R76fr9qlzDBuTtA08 xN/nzfAjn4tMRtHahSDCHo6QdqjHaKFN94o2agNkx8EkplA/7n8IH5u8iMWoz+P6WByYVd 13r83pFlARwZKFDk/d1PTJadSwxtt1N+fwN9W/CojJd0RjAc2wfENN0a6EkdtD842fnoYX rP245D4WBKEJiNNTcFEyKoJwrXYP0zJm50iIx1vICTM9WSHZVa2EDaqNq6lKow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766065527; 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=UcTF5XW0XGa68VbIgixiF5iSC3nINwLU67IyQh//eIU=; b=rwT63asAuNO7lau/RUj0PQZ1AUAbicvdG1LM4hpNvpMLxb2CDjoRBaIGgtFCI7fc34QLW3 gIgCKpM6O5mFdJ7TDaNVMZTqSzq4aOlOU3X0ZZD6GrNQnRKfrsRMQhuvS6j+k/KU6HnB2R OtLE7kkS5qWbZn9GvN7YGQWQQWWcwa6gqEpRnwAVtpW0Zns0he8/1t2vyOAgntrFiR4Wps D/tv0Fp16s0gzyIdCxcEZqk6c2mphuEzwFpQVLL/c1lZNoKC/pMHvdb43uRcgnigOBgAH3 rF7ejgcVaIxhSiel50aZrg4mrjsKuzuUKx1ReaiSQ0xpFS6i7zlnfP7/8GofhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766065527; a=rsa-sha256; cv=none; b=Cj2QLLIZvOPHcTY1vEbrbFCqkRZ1t9jLoiNVqKT4jI5W/b3IRKr874WrOR2bHKzd8LQdJg 1nWzBwy3DuKYdA8HNxg0FqOzhOxgGT3/idD37sLhZzSUYgELtm9TFpWUAcEf3tQ7HL3Mz+ R9aobbZ6IYIQZWwIYe54YBTZKG4g8rxmhGY8eoTi6J7dspZFCVQm773Nw0D5GtFEtaFMil sh5Sc71WwaiiZ5rn2q5GT0Z4vK8PRXiH/k778AI4Jgl4qk3A2HH+uxPLHlRuvnV7ouIomr GcfIaBO8r1M47qdZb+j5qAWeTptI/Wp7IKwqif8BC4DH/ZAf5MGi6Dw92p3ZAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dXBkb1jTYzh07 for ; Thu, 18 Dec 2025 13:45:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31af0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 13:45:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a862e4b5a27c - main - snmp_pf: fix refresh 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a862e4b5a27c356e2584ee74fd9e211c18b1b125 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 13:45:27 +0000 Message-Id: <69440577.31af0.55d25d79@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a862e4b5a27c356e2584ee74fd9e211c18b1b125 commit a862e4b5a27c356e2584ee74fd9e211c18b1b125 Author: Kristof Provost AuthorDate: 2025-12-17 13:22:05 +0000 Commit: Kristof Provost CommitDate: 2025-12-18 13:39:27 +0000 snmp_pf: fix refresh Some refresh functions had two layers of 'do we need to refresh now?' checks, leading to inconsistent refreshes. Consolidate them. PR: 291725 Sponsored by: Rubicon Communications, LLC ("Netgate") --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index 91194516614f..b62ecf791500 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -673,7 +673,7 @@ pf_tables(struct snmp_context __unused *ctx, struct snmp_value *val, return (SNMP_ERR_NOT_WRITEABLE); if (op == SNMP_OP_GET) { - if ((time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE) + if (! started || (time(NULL) - pft_table_age) > PFT_TABLE_MAXAGE) if (pft_refresh() == -1) return (SNMP_ERR_GENERR); @@ -812,7 +812,7 @@ pf_tbladdr(struct snmp_context __unused *ctx, struct snmp_value __unused *val, asn_subid_t which = val->var.subs[sub - 1]; struct pfa_entry *e = NULL; - if ((time(NULL) - pfa_table_age) > PFA_TABLE_MAXAGE) + if (! started || (time(NULL) - pfa_table_age) > PFA_TABLE_MAXAGE) pfa_refresh(); switch (op) { @@ -1035,7 +1035,7 @@ pf_lbltable(struct snmp_context __unused *ctx, struct snmp_value *val, asn_subid_t which = val->var.subs[sub - 1]; struct pfl_entry *e = NULL; - if ((time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE) + if (! started || (time(NULL) - pfl_table_age) > PFL_TABLE_MAXAGE) pfl_refresh(); switch (op) { @@ -1322,9 +1322,6 @@ pft_refresh(void) struct pft_entry *e; int i, numtbls = 1; - if (started && this_tick <= pf_tick) - return (0); - while (!TAILQ_EMPTY(&pft_table)) { e = TAILQ_FIRST(&pft_table); TAILQ_REMOVE(&pft_table, e, link); @@ -1422,9 +1419,6 @@ pfa_refresh(void) struct pfa_entry *e; int i, numtbls = 1, cidx, naddrs; - if (started && this_tick <= pf_tick) - return (0); - while (!TAILQ_EMPTY(&pfa_table)) { e = TAILQ_FIRST(&pfa_table); TAILQ_REMOVE(&pfa_table, e, link); @@ -1590,9 +1584,6 @@ pfl_refresh(void) { struct pfl_entry *e; - if (started && this_tick <= pf_tick) - return (0); - while (!TAILQ_EMPTY(&pfl_table)) { e = TAILQ_FIRST(&pfl_table); TAILQ_REMOVE(&pfl_table, e, link);