summaryrefslogtreecommitdiff
path: root/net/net-snmp/patches/patch-dr
diff options
context:
space:
mode:
Diffstat (limited to 'net/net-snmp/patches/patch-dr')
-rw-r--r--net/net-snmp/patches/patch-dr47
1 files changed, 47 insertions, 0 deletions
diff --git a/net/net-snmp/patches/patch-dr b/net/net-snmp/patches/patch-dr
new file mode 100644
index 00000000000..e6a9a2c1e03
--- /dev/null
+++ b/net/net-snmp/patches/patch-dr
@@ -0,0 +1,47 @@
+$NetBSD: patch-dr,v 1.1 2006/03/19 22:03:29 joerg Exp $
+
+--- agent/mibgroup/mibII/tcpTable.c.orig 2006-03-19 21:24:04.000000000 +0000
++++ agent/mibgroup/mibII/tcpTable.c
+@@ -711,7 +711,11 @@ tcpTable_load(netsnmp_cache *cache, void
+ size_t len;
+ int sname[] = { CTL_NET, PF_INET, IPPROTO_TCP, TCPCTL_PCBLIST };
+ char *tcpcb_buf = NULL;
++#if defined(dragonfly)
++ struct xtcpcb *xig = NULL;
++#else
+ struct xinpgen *xig = NULL;
++#endif
+ netsnmp_inpcb *nnew;
+ int StateMap[] = { 1, 2, 3, 4, 5, 8, 6, 10, 9, 7, 11 };
+
+@@ -733,10 +737,18 @@ tcpTable_load(netsnmp_cache *cache, void
+ * Unpick this into the constituent 'xinpgen' structures, and extract
+ * the 'inpcb' elements into a linked list (built in reverse)
+ */
++#if defined(dragonfly)
++ xig = (struct xtcpcb *) tcpcb_buf;
++#else
+ xig = (struct xinpgen *) tcpcb_buf;
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+
++#if defined(dragonfly)
++ while (xig && ((char *)xig + xig->xt_len < tcpcb_buf + len)) {
++#else
+ while (xig && (xig->xig_len > sizeof(struct xinpgen))) {
++#endif
+ nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
+ if (!nnew)
+ break;
+@@ -749,7 +761,11 @@ tcpTable_load(netsnmp_cache *cache, void
+
+ nnew->inp_next = tcp_head;
+ tcp_head = nnew;
++#if defined(dragonfly)
++ xig = (struct xtcpcb *) ((char *) xig + xig->xt_len);
++#else
+ xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
++#endif
+ }
+
+ free(tcpcb_buf);