$OpenBSD: patch-src_tcpconns_c,v 1.4 2014/11/17 15:23:12 landry Exp $
https://github.com/collectd/collectd/pull/779
https://github.com/collectd/collectd/pull/808
--- src/tcpconns.c.orig	Sun Jan 26 09:09:14 2014
+++ src/tcpconns.c	Mon Sep 22 16:59:13 2014
@@ -896,7 +896,6 @@ static int conn_init (void)
 static int conn_read (void)
 {
   struct inpcbtable table;
-  struct inpcb *head;
   struct inpcb *next;
   struct inpcb inpcb;
   struct tcpcb tcpcb;
@@ -909,18 +908,16 @@ static int conn_read (void)
   if (status != 0)
     return (-1);
 
-  /* Get the `head' pcb */
-  head = (struct inpcb *) &(inpcbtable_ptr->inpt_queue);
   /* Get the first pcb */
-  next = (struct inpcb *)CIRCLEQ_FIRST (&table.inpt_queue);
+  next = (struct inpcb *)TAILQ_FIRST (&table.inpt_queue);
 
-  while (next != head)
+  while (next)
   {
     /* Read the pcb pointed to by `next' into `inpcb' */
     kread ((u_long) next, &inpcb, sizeof (inpcb));
 
     /* Advance `next' */
-    next = (struct inpcb *)CIRCLEQ_NEXT (&inpcb, inp_queue);
+    next = (struct inpcb *)TAILQ_NEXT (&inpcb, inp_queue);
 
     /* Ignore sockets, that are not connected. */
 #ifdef __NetBSD__
@@ -937,7 +934,7 @@ static int conn_read (void)
 
     kread ((u_long) inpcb.inp_ppcb, &tcpcb, sizeof (tcpcb));
     conn_handle_ports (ntohs(inpcb.inp_lport), ntohs(inpcb.inp_fport), tcpcb.t_state);
-  } /* while (next != head) */
+  } /* while (next) */
 
   conn_submit_all ();
 
