Bug 160900 - net-mgmt/net-snmp 5.7_3 TCP-MIB::tcpCurrEstab.0 returns 0
Summary: net-mgmt/net-snmp 5.7_3 TCP-MIB::tcpCurrEstab.0 returns 0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-22 10:40 UTC by lampa
Modified: 2011-11-24 13:11 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description lampa 2011-09-22 10:40:08 UTC
After upgrade to net-snmp 5.7 counter of TCP connections stopped working:

snmpget -c public -v2c xxx .1.3.6.1.2.1.6.9.0
TCP-MIB::tcpCurrEstab.0 = Gauge32: 0

The reason is this change in net-snmp source ./work/net-snmp-5.7/agent/mibgroup/mibII/tcp.c

#ifdef NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS
        ret_value = TCP_Count_Connections();
#else /*  NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS */
        ret_value = 0;
#endif /*  NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS */

The define NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS is not defined. After addition here:

#define NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS
#ifdef NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS
        ret_value = TCP_Count_Connections();
#else /*  NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS */
        ret_value = 0;
#endif /*  NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS */

counter works again:

snmpget -c public -v2c xxx .1.3.6.1.2.1.6.9.0
TCP-MIB::tcpCurrEstab.0 = Gauge32: 1094

Fix: 

Delete #ifdef or #define NETSNMP_FEATURE_HAS_TCP_COUNT_CONNECTIONS in proper place.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-09-22 10:55:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sylvio

Fix synopsis and assign.
Comment 2 Ryan Steinmetz freebsd_committer freebsd_triage 2011-11-15 17:02:18 UTC
Responsible Changed
From-To: sylvio->zi

I'll take it.
Comment 3 dfilter service freebsd_committer freebsd_triage 2011-11-24 13:07:05 UTC
zi          2011-11-24 13:06:52 UTC

  FreeBSD ports repository

  Added files:
    net-mgmt/net-snmp/files patch-agent__mibgroup__mibII__tcp.c 
  Log:
  - Fix TCP-MIB::tcpCurrEstab.0 reporting
  
  PR:             ports/160900
  Submitted by:   Petr Lampa <lampa@fit.vutbr.cz>
  Obtained from:  upstream commit 87a31bbc009c9515a26c86317475f8384bd70e1b
  Approved by:    maintainer (implicit)
  Feature safe:   yes
  
  Revision  Changes    Path
  1.1       +20 -0     ports/net-mgmt/net-snmp/files/patch-agent__mibgroup__mibII__tcp.c (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Ryan Steinmetz freebsd_committer freebsd_triage 2011-11-24 13:11:54 UTC
State Changed
From-To: open->closed

A fix has been committed and is present in net-snmp-5.7_5.