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:57:39 +0000
commit6a8dd23e2557b165d077a425de5d1ce3b69e06a9 (patch)
treebb23e3ed0827d37f9357583bbc7c5255bd9e3ee4
parent3fc823dd5c8e8ba13e765a193d4a7975f32240b4 (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 (cherry picked from commit 50b9359327b89a6c258f38e336ef5aad4d80eebc)
-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 032a7a907354..df0b25a41f89 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= 12
+PORTREVISION= 13
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;