Author: emax
Date: Wed Jun  6 18:00:38 2012
New Revision: 236693
URL: http://svn.freebsd.org/changeset/base/236693

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

Modified:
  head/contrib/bsnmp/snmp_mibII/mibII_tcp.c

Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c
==============================================================================
--- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c   Wed Jun  6 18:00:19 2012        
(r236692)
+++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c   Wed Jun  6 18:00:38 2012        
(r236693)
@@ -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++;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to