Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 20db51d70e6b59a061db97ce9b89c771 > files > 30

net-snmp-5.3.2.2-14.el5.src.rpm

439794: LTC43540-Value in icmpStatsTable is different from /proc/net/snmp6

Source: Mitsuru Chinen <chinen@jp.ibm.com>
Reviewed by: Jan Safranek <jsafrane@redhat.com>

Correctly distinguish Icmp6In/Out2Reports and Icmp6In/OutMsgs.

--- net-snmp-5.3.1.orig/agent/mibgroup/mibII/kernel_linux.c	2008-03-27 14:56:32.000000000 +0900
+++ net-snmp-5.3.1/agent/mibgroup/mibII/kernel_linux.c	2008-03-27 16:55:30.000000000 +0900
@@ -483,7 +483,11 @@ linux_read_icmp6_parse(struct icmp6_mib 
                     match = 0;
                 }
             } else if ('M' == line[7]) {
-                cached_icmp6_mib.icmp6InMsgs = stats;
+                if ('s' == line[8]) {
+                    cached_icmp6_mib.icmp6InMsgs = stats;
+                } else {
+                    match = 0;
+                }
             } else if ('N' == line[7]) {
                 if ('A' == line[15]) {
                     cached_icmp6_mib.icmp6InNeighborAdvertisements = stats;
@@ -541,7 +545,11 @@ linux_read_icmp6_parse(struct icmp6_mib 
                     match = 0;
                 }
             } else if ('M' == line[8]) {
-                cached_icmp6_mib.icmp6OutMsgs = stats;
+                if ('s' == line[9]) {
+                    cached_icmp6_mib.icmp6OutMsgs = stats;
+                } else {
+                    match = 0;
+                }
             } else if ('N' == line[8]) {
                 if ('A' == line[16]) {
                     cached_icmp6_mib.icmp6OutNeighborAdvertisements = stats;
@@ -567,7 +575,11 @@ linux_read_icmp6_parse(struct icmp6_mib 
                     match = 0;
                 }
             } else if ('T' == line[8]) {
-                cached_icmp6_mib.icmp6OutTimeExcds = stats;
+                if ('i' == line[9]) {
+                    cached_icmp6_mib.icmp6OutTimeExcds = stats;
+                } else {
+                    match = 0;
+                }
             } else {
                 match = 0;
             }