7186501 net-snmp crashes in net_cpu_arch_load s11-sru
authorLijo George - Oracle Corporation - Bangalore India <lijo.x.george@oracle.com>
Sat, 20 Oct 2012 07:13:05 -0700
branchs11-sru
changeset 2392 19355fbf02e9
parent 2391 811524a2620b
child 2393 04cb206e45dd
7186501 net-snmp crashes in net_cpu_arch_load
components/net-snmp/patches/022.7186501.cpu_kstat.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/022.7186501.cpu_kstat.patch	Sat Oct 20 07:13:05 2012 -0700
@@ -0,0 +1,11 @@
+--- net-snmp-5.4.1/agent/mibgroup/hardware/cpu/cpu_kstat.c	Thu Oct  5 08:53:42 2006
++++ net-snmp-5.4.1.mod/agent/mibgroup/hardware/cpu/cpu_kstat.c	Thu Mar 29 07:57:19 2012
+@@ -103,6 +103,8 @@
+         if (strcmp(ksp->ks_module, "cpu_stat") == 0) {
+             i    = ksp->ks_instance;
+             cpu2 = netsnmp_cpu_get_byIdx( i, 0 );
++            if ( !cpu2 )
++                    break;  /* or continue ?*/ /*Skip new CPUs */
+             if ((ksp->ks_type != KSTAT_TYPE_RAW) ||
+                 (ksp->ks_data_size != sizeof(cs))||
+                 (kstat_read(kstat_fd, ksp, &cs) == -1)) {