Fix based on net-snmp git commit a1fd64716f6794c55c34d77e618210238a73bfa1.

diff -Nur net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/icmp.c net-snmp-5.4.2.1/agent/mibgroup/mibII/icmp.c
--- net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/icmp.c	2014-03-07 10:59:43.000000000 +0100
+++ net-snmp-5.4.2.1/agent/mibgroup/mibII/icmp.c	2014-03-10 14:06:19.120654000 +0100
@@ -97,10 +97,20 @@
 	int flags;
 };
 
+#ifdef linux
+/* Linux keeps track of all possible message types */
+#define ICMP_MSG_STATS_IPV4_COUNT 256
+#else
 #define ICMP_MSG_STATS_IPV4_COUNT 11
+#endif
 
 #ifdef NETSNMP_ENABLE_IPV6
+#ifdef linux
+/* Linux keeps track of all possible message types */
+#define ICMP_MSG_STATS_IPV6_COUNT 256
+#else
 #define ICMP_MSG_STATS_IPV6_COUNT 14
+#endif
 #else
 #define ICMP_MSG_STATS_IPV6_COUNT 0
 #endif /* NETSNMP_ENABLE_IPV6 */
@@ -166,7 +176,7 @@
     inc = 0;
     linux_read_icmp_msg_stat(&v4icmp, &v4icmpmsg, &flag);
     if (flag) {
-        while (254 != k) {
+        while (255 >= k) {
             if (v4icmpmsg.vals[k].InType) {
                 icmp_msg_stats_table[i].ipVer = 1;
                 icmp_msg_stats_table[i].icmpMsgStatsType = k;
@@ -256,7 +266,7 @@
     inc = 0;
     linux_read_icmp6_msg_stat(&v6icmp, &v6icmpmsg, &flag);
     if (flag) {
-        while (254 != k) {
+        while (255 >= k) {
             if (v6icmpmsg.vals[k].InType) {
                 icmp_msg_stats_table[i].ipVer = 2;
                 icmp_msg_stats_table[i].icmpMsgStatsType = k;
@@ -1012,6 +1022,11 @@
 		    continue;
 		table_info = netsnmp_extract_table_info(request);
 		subid = table_info->colnum;
+                DEBUGMSGTL(( "mibII/icmpMsgStatsTable", "oid: " ));
+                DEBUGMSGOID(( "mibII/icmpMsgStatsTable", request->requestvb->name,
+                                 request->requestvb->name_length ));
+                DEBUGMSG(( "mibII/icmpMsgStatsTable", " In %d Out %d Flags 0x%x\n",
+                                 entry->icmpMsgStatsInPkts, entry->icmpMsgStatsOutPkts, entry->flags ));
 
 		switch (subid) {
 		    case ICMP_MSG_STAT_IN_PKTS:
@@ -1083,6 +1098,12 @@
 					continue;
 				table_info = netsnmp_extract_table_info(request);
 				subid      = table_info->colnum;
+				DEBUGMSGTL(( "mibII/icmpStatsTable", "oid: " ));
+				DEBUGMSGOID(( "mibII/icmpStatsTable", request->requestvb->name,
+						 request->requestvb->name_length ));
+				DEBUGMSG(( "mibII/icmpStatsTable", " In %d InErr %d Out %d OutErr %d\n",
+					      entry->icmpStatsInMsgs, entry->icmpStatsInErrors,
+					      entry->icmpStatsOutMsgs, entry->icmpStatsOutErrors ));
 
 				switch (subid) {
 					case ICMP_STAT_INMSG:
diff -Nur net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/kernel_linux.c net-snmp-5.4.2.1/agent/mibgroup/mibII/kernel_linux.c
--- net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/kernel_linux.c	2014-03-07 10:59:43.000000000 +0100
+++ net-snmp-5.4.2.1/agent/mibgroup/mibII/kernel_linux.c	2014-03-10 14:08:20.174891000 +0100
@@ -79,9 +79,9 @@
 	    index = strtol(token, &delim, 0);
 	    if (ERANGE == errno) {
 		continue;
-	    } else if (index > LONG_MAX) {
+	    } else if (index > 255) {
 		continue;
-	    } else if (index < LONG_MIN) {
+	    } else if (index < 0) {
 		continue;
 	    }
 	    if (NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
@@ -92,9 +92,9 @@
 	    index = strtol(token, &delim, 0);
 	    if (ERANGE == errno) {
 		continue;
-	    } else if (index > LONG_MAX) {
+	    } else if (index > 255) {
 		continue;
-	    } else if (index < LONG_MIN) {
+	    } else if (index < 0) {
 		continue;
 	    }
 	    if(NULL == (token = strtok_r(dataptr, " ", &saveptr1)))
@@ -382,7 +382,7 @@
     char            line[1024];
     char            name[255];
     unsigned long   stats;
-    char           *endp ,*token, *vals;
+    char           *endp, *vals;
     int             match;
 #endif
 
@@ -412,14 +412,21 @@
 
         vals = name;
         if (NULL != icmp6msgstat) {
+            int type;
             if (0 == strncmp(name, "Icmp6OutType", 12)) {
-                token = strsep(&vals, "e");
-                icmp6msgstat->vals[atoi(vals)].OutType = stats;
+                strsep(&vals, "e");
+                type = atoi(vals);
+                if ( type < 0 || type > 255 )
+                    continue;
+                icmp6msgstat->vals[type].OutType = stats;
                 *support = 1;
                 continue;
             } else if (0 == strncmp(name, "Icmp6InType", 11)) {
-                token = strsep(&vals, "e");
-                icmp6msgstat->vals[atoi(vals)].InType = stats;
+                strsep(&vals, "e");
+                type = atoi(vals);
+                if ( type < 0 || type > 255 )
+                    continue;
+                icmp6msgstat->vals[type].InType = stats;
                 *support = 1;
                 continue;
             }
diff -Nur net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/kernel_linux.h net-snmp-5.4.2.1/agent/mibgroup/mibII/kernel_linux.h
--- net-snmp-5.4.2.1-orig/agent/mibgroup/mibII/kernel_linux.h	2014-03-07 10:59:43.000000000 +0100
+++ net-snmp-5.4.2.1/agent/mibgroup/mibII/kernel_linux.h	2014-03-10 14:00:09.344876000 +0100
@@ -121,11 +121,11 @@
 
 /* Lets use wrapper structures for future expansion */
 struct icmp4_msg_mib {
-    struct icmp_msg_mib vals[255];
+    struct icmp_msg_mib vals[256];
 };
 
 struct icmp6_msg_mib {
-    struct icmp_msg_mib vals[255];
+    struct icmp_msg_mib vals[256];
 };
 
 struct udp_mib {
