[collectd] [PATCH] Make tcpconns run on OpenBSD

Michael Stapelberg michael at stapelberg.de
Mon Aug 18 17:48:10 CEST 2008


Hi octo,

* [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
this:
        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
Exactly.

> 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
> like:
>   Checking for kernel type (???).. unknown
> That line should be one of the first. Could you tell me what's in the
> parenthesis?
Sure:
	checking for kernel type (openbsd4.2)... unknown

Best regards,
Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080818/efc6db57/attachment.pgp 


More information about the collectd mailing list