Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Feb 2025 09:11:27 GMT
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 08d01204175d - main - snmp_pf: fix rules->label use
Message-ID:  <202502210911.51L9BRBQ086680@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kp:

URL: https://cgit.FreeBSD.org/src/commit/?id=08d01204175dae496742e9ccd570363b267284e8

commit 08d01204175dae496742e9ccd570363b267284e8
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-02-21 08:49:06 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-02-21 08:49:06 +0000

    snmp_pf: fix rules->label use
    
    We now support multiple lables on a rule, so 'rule' is an array of strings, not
    just one string. Adjust the check for 'is there a label?'.
    
    CID:            1471808
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
index 782e5503c8a3..0e40bcfb843e 100644
--- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
+++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c
@@ -1531,7 +1531,7 @@ pfl_scan_ruleset(const char *path)
 			goto err;
 		}
 
-		if (rule.label[0]) {
+		if (rule.label[0][0]) {
 			e = (struct pfl_entry *)malloc(sizeof(*e));
 			if (e == NULL)
 				goto err;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502210911.51L9BRBQ086680>