diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c new file mode 100644 --- /dev/null +++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c @@ -0,0 +1,33 @@ +--- agent/mibgroup/mibII/tcpTable.c.orig 2023-08-15 20:32:01 UTC ++++ agent/mibgroup/mibII/tcpTable.c +@@ -50,6 +50,14 @@ + #undef _KERNEL + #endif + ++/* FreeBSD: need version macro and TCP/PCB snapshot structs */ ++#if defined(__FreeBSD__) ++#include /* __FreeBSD_version */ ++#include /* needed so tcp_var.h declares struct xtcpcb */ ++#include /* struct xinpcb, inp_* */ ++#include /* struct xtcpcb, t_state */ ++#endif ++ + #if defined(cygwin) || defined(mingw32) + #include + #endif +@@ -954,7 +962,14 @@ tcpTable_load(netsnmp_cache *cache, void *vmagic) + #if defined(freebsd4) || defined(darwin) + #define NS_ELEM struct xtcpcb + #else +-#define NS_ELEM struct xinpcb ++#if defined(__FreeBSD__) && (__FreeBSD_version >= 1500064) ++/* ++ * FreeBSD 15+: pcblist entries are xtcpcb (contains xt_inp and t_state) ++ */ ++#define NS_ELEM struct xtcpcb ++#else ++#define NS_ELEM struct xinpcb ++#endif + #endif + + int