[collectd] [PATCH] Make tcpconns run on OpenBSD
michael at stapelberg.de
Mon Aug 18 17:48:10 CEST 2008
* [18.08.08 17:32]:
> Shouldn't the `CIRCLEQ_FIRST' be skipped in the code above? I've found a
> version of OpenBSD's netstat (1.29) and it doesn't do that
> `CIRCLEQ_FIRST' when initializing `head'. Also, isn't this `&' before
> the macro one indirection too many?
You're right, I just checked OpenBSD 4.2's systat and they're doing it like
prev = head = (struct inpcb *)&((struct inpcbtable *)off)->inpt_queue;
Let's see how the stats change when I implement it right :-).
> Also, I've dropped `prev' completely because it's never used.
Yes, I've overlooked that.
> > + if (inet_lnaof(inpcb.inp_laddr) == INADDR_ANY)
> > + continue;
> This looks a lot as if you're ignoring entries, where the local address
> is the any address. My guess is that you want to skip unconnected
> sockets, right? From the netstat code I have this looks like the way to
> go. However, shouldn't we check for IPv6, too? The code I see here does:
> if ((inpcb.inp_flags & INP_IPV6)
> && IN6_IS_ADDR_UNSPECIFIED(&inpcb.inp_laddr6))
Please, do so :-).
> Last but not least: When running `configure', you should get a line
> Checking for kernel type (???).. unknown
> That line should be one of the first. Could you tell me what's in the
checking for kernel type (openbsd4.2)... unknown
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080818/efc6db57/attachment.pgp
More information about the collectd