Count both IPv4 and IPv6 TCP connections in tcpCurrEstab

Timeout from:	current, syrinx
MFC after:	1 week
This commit is contained in:
Maksim Yevmenkin 2012-06-06 18:00:38 +00:00
parent 3d9a151daf
commit 6c9707c3b2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236693

View File

@ -109,10 +109,12 @@ fetch_tcp(void)
ptr = (struct xinpgen *)(void *)((char *)ptr + ptr->xig_len)) {
tp = (struct xtcpcb *)ptr;
if (tp->xt_inp.inp_gencnt > xinpgen->xig_gen ||
(tp->xt_inp.inp_vflag & INP_IPV4) == 0)
(tp->xt_inp.inp_vflag & (INP_IPV4|INP_IPV6)) == 0)
continue;
tcp_total++;
if (tp->xt_inp.inp_vflag & INP_IPV4)
tcp_total++;
if (tp->xt_tp.t_state == TCPS_ESTABLISHED ||
tp->xt_tp.t_state == TCPS_CLOSE_WAIT)
tcp_count++;