aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLexi Winter <ivy@FreeBSD.org>2026-03-02 18:45:34 +0000
committerLexi Winter <ivy@FreeBSD.org>2026-03-02 18:45:34 +0000
commit50b9359327b89a6c258f38e336ef5aad4d80eebc (patch)
treed931f3ceacf116b20f6dce2aa226002fa2567620
parent8840fc1bd8ba5d07e0c252f709271acc74d90005 (diff)
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
-rw-r--r--sysutils/snmp_exporter/Makefile2
-rw-r--r--sysutils/snmp_exporter/files/patch-generator_net__snmp.go20
2 files changed, 21 insertions, 1 deletions
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;