git: 50b9359327b8 - main - sysutils/snmp_exporter: Fix snmp_exporter_generator crash
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 02 Mar 2026 18:50:20 UTC
The branch main has been updated by ivy:
URL: https://cgit.FreeBSD.org/ports/commit/?id=50b9359327b89a6c258f38e336ef5aad4d80eebc
commit 50b9359327b89a6c258f38e336ef5aad4d80eebc
Author: Lexi Winter <ivy@FreeBSD.org>
AuthorDate: 2026-03-02 18:45:34 +0000
Commit: Lexi Winter <ivy@FreeBSD.org>
CommitDate: 2026-03-02 18:45:34 +0000
sysutils/snmp_exporter: Fix snmp_exporter_generator crash
Backport upstream PR #1550 to fix a crash when using net-snmp 5.9.5.0
or later.
PR: 292628
MFH: 2026Q1
Reviewed by: arrowd, jrm
Approved by: arrowd (ports)
Obtained from: https://github.com/prometheus/snmp_exporter/pull/1550
Sponsored by: https://www.patreon.com/bsdivy
Differential Revision: https://reviews.freebsd.org/D55620
---
sysutils/snmp_exporter/Makefile | 2 +-
.../snmp_exporter/files/patch-generator_net__snmp.go | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/sysutils/snmp_exporter/Makefile b/sysutils/snmp_exporter/Makefile
index df0b25a41f89..9612d7bd803b 100644
--- a/sysutils/snmp_exporter/Makefile
+++ b/sysutils/snmp_exporter/Makefile
@@ -1,7 +1,7 @@
PORTNAME= snmp_exporter
DISTVERSIONPREFIX=v
DISTVERSION= 0.29.0
-PORTREVISION= 13
+PORTREVISION= 14
CATEGORIES= sysutils
MAINTAINER= ivy@FreeBSD.org
diff --git a/sysutils/snmp_exporter/files/patch-generator_net__snmp.go b/sysutils/snmp_exporter/files/patch-generator_net__snmp.go
new file mode 100644
index 000000000000..5db543473ff7
--- /dev/null
+++ b/sysutils/snmp_exporter/files/patch-generator_net__snmp.go
@@ -0,0 +1,20 @@
+--- generator/net_snmp.go.orig 2026-03-02 17:36:00 UTC
++++ generator/net_snmp.go
+@@ -19,6 +19,7 @@ package main
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/mib_api.h>
+ #include <net-snmp/agent/agent_callbacks.h>
++#include <net-snmp/library/snmp_api.h>
+ #include <net-snmp/library/default_store.h>
+ #include <net-snmp/library/parse.h>
+ #include <unistd.h>
+@@ -41,6 +42,9 @@ struct tc {
+ struct enum_list *enums;
+ struct range_list *ranges;
+ char *description;
++#if defined(SNMP_FLAGS_SESSION_USER)
++ int lineno;
++#endif
+ #if !defined(NETSNMP_DS_LIB_ADD_FORWARDER_INFO)
+ } tclist[MAXTC];
+ int tc_alloc = MAXTC;