svn commit: r237078 - stable/9/contrib/bsnmp/snmp_mibII

Maksim Yevmenkin emax at FreeBSD.org
Thu Jun 14 15:39:15 UTC 2012


Author: emax
Date: Thu Jun 14 15:39:14 2012
New Revision: 237078
URL: http://svn.freebsd.org/changeset/base/237078

Log:
  MFC r236693
  
  Count both IPv4 and IPv6 TCP connections in tcpCurrEstab
  
  Timeout from:	current, syrinx

Modified:
  stable/9/contrib/bsnmp/snmp_mibII/mibII_tcp.c
Directory Properties:
  stable/9/contrib/bsnmp/   (props changed)

Modified: stable/9/contrib/bsnmp/snmp_mibII/mibII_tcp.c
==============================================================================
--- stable/9/contrib/bsnmp/snmp_mibII/mibII_tcp.c	Thu Jun 14 15:37:15 2012	(r237077)
+++ stable/9/contrib/bsnmp/snmp_mibII/mibII_tcp.c	Thu Jun 14 15:39:14 2012	(r237078)
@@ -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++;


More information about the svn-src-stable-9 mailing list