[117493] trunk/dports/net/net-snmp

ryandesign at macports.org ryandesign at macports.org
Fri Feb 28 23:00:59 PST 2014


Revision: 117493
          https://trac.macports.org/changeset/117493
Author:   ryandesign at macports.org
Date:     2014-02-28 23:00:59 -0800 (Fri, 28 Feb 2014)
Log Message:
-----------
net-snmp: apply a patch consisting of the fixes upstream released in 5.7.2.1; we cannot use the actual 5.7.2.1 tarball because it was created improperly

Modified Paths:
--------------
    trunk/dports/net/net-snmp/Portfile

Added Paths:
-----------
    trunk/dports/net/net-snmp/files/patch-5.7.2.1.diff

Modified: trunk/dports/net/net-snmp/Portfile
===================================================================
--- trunk/dports/net/net-snmp/Portfile	2014-03-01 06:02:10 UTC (rev 117492)
+++ trunk/dports/net/net-snmp/Portfile	2014-03-01 07:00:59 UTC (rev 117493)
@@ -5,7 +5,7 @@
 
 name                    net-snmp
 version                 5.7.2
-revision                1
+revision                2
 categories              net
 license                 BSD
 platforms               darwin
@@ -34,6 +34,7 @@
 
 patchfiles              patch-configure.diff
 patchfiles-append       patch-include-net-snmp-system-darwin13.h.diff
+patchfiles-append       patch-5.7.2.1.diff
 
 depends_lib             port:openssl \
                         port:zlib \

Added: trunk/dports/net/net-snmp/files/patch-5.7.2.1.diff
===================================================================
--- trunk/dports/net/net-snmp/files/patch-5.7.2.1.diff	                        (rev 0)
+++ trunk/dports/net/net-snmp/files/patch-5.7.2.1.diff	2014-03-01 07:00:59 UTC (rev 117493)
@@ -0,0 +1,134 @@
+Update to 5.7.2.1
+https://sourceforge.net/p/net-snmp/bugs/2526/
+--- agent/mibgroup/mibII/icmp.c.orig	2012-10-09 17:28:58.000000000 -0500
++++ agent/mibgroup/mibII/icmp.c	2014-02-19 18:36:42.000000000 -0600
+@@ -106,10 +106,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 */
+@@ -177,7 +187,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;
+@@ -267,7 +277,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;
+@@ -1050,6 +1060,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:
+@@ -1117,6 +1133,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:
+--- agent/mibgroup/mibII/kernel_linux.c.orig	2012-10-09 17:28:58.000000000 -0500
++++ agent/mibgroup/mibII/kernel_linux.c	2014-02-19 18:36:42.000000000 -0600
+@@ -81,9 +81,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)))
+@@ -94,9 +94,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)))
+@@ -426,14 +426,21 @@
+ 
+         vals = name;
+         if (NULL != icmp6msgstat) {
++            int type;
+             if (0 == strncmp(name, "Icmp6OutType", 12)) {
+                 strsep(&vals, "e");
+-                icmp6msgstat->vals[atoi(vals)].OutType = stats;
++                type = atoi(vals);
++                if ( type < 0 || type > 255 )
++                    continue;
++                icmp6msgstat->vals[type].OutType = stats;
+                 *support = 1;
+                 continue;
+             } else if (0 == strncmp(name, "Icmp6InType", 11)) {
+                 strsep(&vals, "e");
+-                icmp6msgstat->vals[atoi(vals)].InType = stats;
++                type = atoi(vals);
++                if ( type < 0 || type > 255 )
++                    continue;
++                icmp6msgstat->vals[type].InType = stats;
+                 *support = 1;
+                 continue;
+             }
+--- agent/mibgroup/mibII/kernel_linux.h.orig	2012-10-09 17:28:58.000000000 -0500
++++ agent/mibgroup/mibII/kernel_linux.h	2014-02-19 18:36:42.000000000 -0600
+@@ -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 {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140228/c29dd74e/attachment.html>


More information about the macports-changes mailing list