X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftcpconns.c;h=f12ce5c6969583f8b6aa93eb9f3770c0f8b951c6;hb=867ad628dc6fcd05bd584b605d7093cfc00c3d07;hp=419d8c19e8aa69242495fddabb371d06831a4586;hpb=307c875e5a78a2729fbbe1a588d232e9a129d75a;p=collectd.git diff --git a/src/tcpconns.c b/src/tcpconns.c index 419d8c19..f12ce5c6 100644 --- a/src/tcpconns.c +++ b/src/tcpconns.c @@ -774,9 +774,15 @@ static int conn_read(void) { for (in_ptr = (struct xinpgen *)(((char *)in_orig) + in_orig->xig_len); in_ptr->xig_len > sizeof(struct xinpgen); in_ptr = (struct xinpgen *)(((char *)in_ptr) + in_ptr->xig_len)) { +#if __FreeBSD_version >= 1200026 + struct xtcpcb *tp = (struct xtcpcb *)in_ptr; + struct xinpcb *inp = &tp->xt_inp; + struct xsocket *so = &inp->xi_socket; +#else struct tcpcb *tp = &((struct xtcpcb *)in_ptr)->xt_tp; struct inpcb *inp = &((struct xtcpcb *)in_ptr)->xt_inp; struct xsocket *so = &((struct xtcpcb *)in_ptr)->xt_socket; +#endif /* Ignore non-TCP sockets */ if (so->xso_protocol != IPPROTO_TCP)