summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Marlowe <mattm@gentoo.org>2006-10-23 13:04:30 +0000
committerMatthew Marlowe <mattm@gentoo.org>2006-10-23 13:04:30 +0000
commit0f08e893c5deea2d7fb25f006c1676a901b2053d (patch)
tree2b70cb5a8b823b9ecae1070625a3d660db733dd3 /net-analyzer/net-snmp
parentremoved quotes around socket, fix bug #152455 (diff)
downloadhistorical-0f08e893c5deea2d7fb25f006c1676a901b2053d.tar.gz
historical-0f08e893c5deea2d7fb25f006c1676a901b2053d.tar.bz2
historical-0f08e893c5deea2d7fb25f006c1676a901b2053d.zip
added some patches to net-snmp-5.3.1 to deal with 64 bit issues among others (patch source: redhat). Should hopefully make amd64/sun users happy.
Package-Manager: portage-2.1.1
Diffstat (limited to 'net-analyzer/net-snmp')
-rw-r--r--net-analyzer/net-snmp/ChangeLog12
-rw-r--r--net-analyzer/net-snmp/Manifest31
-rw-r--r--net-analyzer/net-snmp/files/digest-net-snmp-5.3.0.12
-rw-r--r--net-analyzer/net-snmp/files/digest-net-snmp-5.3.1-r13
-rw-r--r--net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch93
-rw-r--r--net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch233
-rw-r--r--net-analyzer/net-snmp/net-snmp-5.3.1-r1.ebuild188
7 files changed, 553 insertions, 9 deletions
diff --git a/net-analyzer/net-snmp/ChangeLog b/net-analyzer/net-snmp/ChangeLog
index eb3fa4d3c8da..9a6bc65464d6 100644
--- a/net-analyzer/net-snmp/ChangeLog
+++ b/net-analyzer/net-snmp/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-analyzer/net-snmp
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/ChangeLog,v 1.138 2006/10/22 22:28:20 mattm Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/ChangeLog,v 1.139 2006/10/23 13:04:29 mattm Exp $
+
+*net-snmp-5.3.1-r1 (23 Oct 2006)
+
+ 23 Oct 2006; Matthew Marlowe <mattm@gentoo.org>
+ +files/net-snmp-5.3.1-retrans-time.patch,
+ +files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch,
+ +net-snmp-5.3.1-r1.ebuild:
+ Adding several critical patches (source: redhat/fedora) for net-snmp 5.3.1 and
+ modifying the net-snmp-5.3.1-r1 ebuild to automatically apply them.
+ Hopefully, the patches will fix some amd64 and possibly sun issues.
22 Oct 2006; Matthew Marlowe <mattm@gentoo.org> ChangeLog:
version bump (5.3.1), fixed bugs #120412 and #152166.
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest
index 69024a4adfa3..b5e507634d66 100644
--- a/net-analyzer/net-snmp/Manifest
+++ b/net-analyzer/net-snmp/Manifest
@@ -18,6 +18,14 @@ AUX net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 RMD160 3b716cac3df53db19b2c4eb295
MD5 ca3a2ba5a12a796d29087038828f2c21 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815
RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815
SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815
+AUX net-snmp-5.3.1-retrans-time.patch 3240 RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 SHA1 8ca179d5620a1a0b38f45c04d3f790099a426828 SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b
+MD5 5a9189510527a178f92b3b9751d20b6c files/net-snmp-5.3.1-retrans-time.patch 3240
+RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 files/net-snmp-5.3.1-retrans-time.patch 3240
+SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b files/net-snmp-5.3.1-retrans-time.patch 3240
+AUX net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 RMD160 4c2d25a50375f950642a49d79678532f89b36ede SHA1 adea9cce4b81e1d66757194257e9d8d489c32d96 SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b
+MD5 3f888bb1a96a76d1a54af4f0a50fceff files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037
+RMD160 4c2d25a50375f950642a49d79678532f89b36ede files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037
+SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037
AUX net-snmp-lm_sensors.patch 13686 RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 SHA1 3e795339fc93306a4d662feeaa16faca2509a058 SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86
MD5 25d92c9a7adcbb80240a914a8f6bbfe5 files/net-snmp-lm_sensors.patch 13686
RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 files/net-snmp-lm_sensors.patch 13686
@@ -36,7 +44,7 @@ RMD160 aba7b7196835bd359174156a527e13188f76e248 files/snmptrapd.conf 635
SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 files/snmptrapd.conf 635
DIST net-snmp-5.2.1.2.tar.gz 3869893 RMD160 30abfbde24caa7d04990bd111822b98b012f4a0c SHA1 e93a76e081df0bfb5aa126dbad5f182176f9579e SHA256 770c56d059e52ee164cfa0d914618a982e40674a269ce28daddc580c4b67fe60
DIST net-snmp-5.2.2.tar.gz 3919826 RMD160 54c0bcc34ca6462aaab9ba69b06955dd7c11670f SHA1 2c45d24c5784b8b469e9ba3fde9eeeeabbcb7ab0 SHA256 ed5cc617e4cfe38af64a3ded8542c4e61d045dbeec00d5b93a31afc3337135fd
-DIST net-snmp-5.3.0.1.tar.gz 4183370
+DIST net-snmp-5.3.0.1.tar.gz 4183370 RMD160 86b7e56b512faf73d2a08ac3df2def4560b62945 SHA1 c58ddabe4281c3681a268bd48de6865e812f2ec5 SHA256 dc7786ad2b1464edb5d8331a2687fa72f979ce3984df4e94334e8eec0676e69d
DIST net-snmp-5.3.1.tar.gz 4210843 RMD160 7bcdd213fb2517d0927b030deab5146522b58b3d SHA1 8ddb5122769814f04a7d3d352dcc640df7c89d41 SHA256 fb6d5113ccdd8c4661fe5d825160e45a7c5035b145e24ec18f71a509ecb0fe43
EBUILD net-snmp-5.2.1.2-r1.ebuild 5234 RMD160 5c43b15e234cd469a792ec3eeb445635931b038e SHA1 02dc4b293b9192e5a23e5c68030656d466d42a51 SHA256 1dbc840be6083391f8ba6b106ee826b5e99c4e76ed3747b21ce1a55bd41a2391
MD5 5f6da3f097d0faaad9e0e7d41c1447bd net-snmp-5.2.1.2-r1.ebuild 5234
@@ -50,14 +58,18 @@ EBUILD net-snmp-5.3.0.1.ebuild 5481 RMD160 3f1c5aa0fa09202752040bfc54b0b4b203888
MD5 53126ec37b65e18c5ea91cfcd8915456 net-snmp-5.3.0.1.ebuild 5481
RMD160 3f1c5aa0fa09202752040bfc54b0b4b203888462 net-snmp-5.3.0.1.ebuild 5481
SHA256 c8fb2c6180b967511d67bdf0cd9cedce61be9a207650115eb92be216c0de97ec net-snmp-5.3.0.1.ebuild 5481
+EBUILD net-snmp-5.3.1-r1.ebuild 5654 RMD160 79fa4f4932d0ace14e2c6ef036bdb930ca9a9e55 SHA1 3b760d25b7e2e8d88bfa3bc364aa4b2dece8be0a SHA256 2e8a5ac0cc2bc72371b5f6dd857ec448e86b2528936d56529a8606e3a9309ba6
+MD5 331731665e3e0df5befbff3aa2328ed3 net-snmp-5.3.1-r1.ebuild 5654
+RMD160 79fa4f4932d0ace14e2c6ef036bdb930ca9a9e55 net-snmp-5.3.1-r1.ebuild 5654
+SHA256 2e8a5ac0cc2bc72371b5f6dd857ec448e86b2528936d56529a8606e3a9309ba6 net-snmp-5.3.1-r1.ebuild 5654
EBUILD net-snmp-5.3.1.ebuild 5479 RMD160 48669a4b26843761b48b0d7598b87b5d6e200ae1 SHA1 9807cf45e08a8c2ce2f7f95dbb659baad4364ba0 SHA256 c53816faeaf5f3ce2499e2fcfa5bb6a1de16cff45d444f94bb462a3888d1b3c3
MD5 0a6cc3906711c8ace3d5b32dddb479bd net-snmp-5.3.1.ebuild 5479
RMD160 48669a4b26843761b48b0d7598b87b5d6e200ae1 net-snmp-5.3.1.ebuild 5479
SHA256 c53816faeaf5f3ce2499e2fcfa5bb6a1de16cff45d444f94bb462a3888d1b3c3 net-snmp-5.3.1.ebuild 5479
-MISC ChangeLog 22559 RMD160 41ea30fb4a66dc4d7a97385c0e01107d14f6bd24 SHA1 7d8a803076bd9fcad15e9aaf3cc428aaa94ddb39 SHA256 d857f01ff2525384d7793b97754ec8e512e90209a20873dba7f281d1fd3c4a80
-MD5 69added76e8e15ac41fbe67d0a60fbdb ChangeLog 22559
-RMD160 41ea30fb4a66dc4d7a97385c0e01107d14f6bd24 ChangeLog 22559
-SHA256 d857f01ff2525384d7793b97754ec8e512e90209a20873dba7f281d1fd3c4a80 ChangeLog 22559
+MISC ChangeLog 22991 RMD160 923e1038c49d6f17450717f55beedcf14bb11483 SHA1 6234a6e16d8a1e094abd74450ff4b4637378988e SHA256 5a935d0399722aac6333b917e17021176be0ce167be94048fb35f3a3fa44d120
+MD5 f137226c58a5061950b49f92af20aaa0 ChangeLog 22991
+RMD160 923e1038c49d6f17450717f55beedcf14bb11483 ChangeLog 22991
+SHA256 5a935d0399722aac6333b917e17021176be0ce167be94048fb35f3a3fa44d120 ChangeLog 22991
MISC metadata.xml 160 RMD160 2738573ec519cbef4b293bc132f7dd9d02291137 SHA1 29b8b234e0f3a475b50bd4df1ef8b4e5749823ce SHA256 39e232fc7ec88ca0b077cb3950cb39d15cd990842b88d5bfe14f02f34d72f37b
MD5 637389da071d8ee0c0292695525bc29f metadata.xml 160
RMD160 2738573ec519cbef4b293bc132f7dd9d02291137 metadata.xml 160
@@ -68,9 +80,12 @@ SHA256 6482f91a0e470d99ea91c3ceb723e6ee3c82320eb96071116cdf57b021186b1f files/di
MD5 31a617d8717329eaab7e2e4e998da3ad files/digest-net-snmp-5.2.2-r3 247
RMD160 84d045de83961306e7908bfdff02665fe6ebb9c0 files/digest-net-snmp-5.2.2-r3 247
SHA256 8082447b2cf48c79d578b97f7a2773a06fa5e0810dc6329849e5030090508647 files/digest-net-snmp-5.2.2-r3 247
-MD5 d3cebd37f9a75b0968bd7a60fb68e7eb files/digest-net-snmp-5.3.0.1 69
-RMD160 3af61ce289bac38d223f56234ebf8be9e0bceb22 files/digest-net-snmp-5.3.0.1 69
-SHA256 3f8af1549b44c40f31793214b995359339a3e34263c436ccbc60aaaff3b73141 files/digest-net-snmp-5.3.0.1 69
+MD5 7edcb252f249446b3bfef9c4e31f756d files/digest-net-snmp-5.3.0.1 253
+RMD160 d08868e0df5ff6669946cffe71f313a1573ecccb files/digest-net-snmp-5.3.0.1 253
+SHA256 75e80bbe578e823e75c5fba376f8260eed2342b8cf33d5e50ed6cdeabc1bf418 files/digest-net-snmp-5.3.0.1 253
MD5 d8afb2f50cb9a9cfeaea5135b41541b0 files/digest-net-snmp-5.3.1 247
RMD160 524e66315ff4fab8e6760066d1d88a4aaafe8ba5 files/digest-net-snmp-5.3.1 247
SHA256 57af851df7613f792fa9dac8cec68746943eb997c4b19589733df8a6a8176709 files/digest-net-snmp-5.3.1 247
+MD5 d8afb2f50cb9a9cfeaea5135b41541b0 files/digest-net-snmp-5.3.1-r1 247
+RMD160 524e66315ff4fab8e6760066d1d88a4aaafe8ba5 files/digest-net-snmp-5.3.1-r1 247
+SHA256 57af851df7613f792fa9dac8cec68746943eb997c4b19589733df8a6a8176709 files/digest-net-snmp-5.3.1-r1 247
diff --git a/net-analyzer/net-snmp/files/digest-net-snmp-5.3.0.1 b/net-analyzer/net-snmp/files/digest-net-snmp-5.3.0.1
index 9422e94f60a7..7008f1a40c6d 100644
--- a/net-analyzer/net-snmp/files/digest-net-snmp-5.3.0.1
+++ b/net-analyzer/net-snmp/files/digest-net-snmp-5.3.0.1
@@ -1 +1,3 @@
MD5 db5995ff8fae154cbe7417a4a6f2ca60 net-snmp-5.3.0.1.tar.gz 4183370
+RMD160 86b7e56b512faf73d2a08ac3df2def4560b62945 net-snmp-5.3.0.1.tar.gz 4183370
+SHA256 dc7786ad2b1464edb5d8331a2687fa72f979ce3984df4e94334e8eec0676e69d net-snmp-5.3.0.1.tar.gz 4183370
diff --git a/net-analyzer/net-snmp/files/digest-net-snmp-5.3.1-r1 b/net-analyzer/net-snmp/files/digest-net-snmp-5.3.1-r1
new file mode 100644
index 000000000000..c0eb0c226959
--- /dev/null
+++ b/net-analyzer/net-snmp/files/digest-net-snmp-5.3.1-r1
@@ -0,0 +1,3 @@
+MD5 360a9783dbc853bab6bda90d961daee5 net-snmp-5.3.1.tar.gz 4210843
+RMD160 7bcdd213fb2517d0927b030deab5146522b58b3d net-snmp-5.3.1.tar.gz 4210843
+SHA256 fb6d5113ccdd8c4661fe5d825160e45a7c5035b145e24ec18f71a509ecb0fe43 net-snmp-5.3.1.tar.gz 4210843
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch b/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch
new file mode 100644
index 000000000000..45eb35cff2a8
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch
@@ -0,0 +1,93 @@
+Index: agent/mibgroup/if-mib/data_access/interface_linux.c
+===================================================================
+--- agent/mibgroup/if-mib/data_access/interface_linux.c.orig
++++ agent/mibgroup/if-mib/data_access/interface_linux.c
+@@ -22,6 +22,8 @@
+ #include "interface_ioctl.h"
+
+ #include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #ifdef HAVE_LINUX_ETHTOOL_H
+ #include <sys/types.h>
+@@ -40,6 +42,10 @@ unsigned int
+ netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name);
+ #endif
+
++#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS "/proc/sys/net/ipv%d/neigh/%s/retrans_time_ms"
++#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME "/proc/sys/net/ipv%d/neigh/%s/retrans_time"
++static char *proc_sys_retrans_time;
++static unsigned short retrans_time_factor = 0;
+
+ void
+ netsnmp_arch_interface_init(void)
+@@ -47,6 +53,20 @@ netsnmp_arch_interface_init(void)
+ /*
+ * nothing to do
+ */
++ char proc_path[64+IF_NAMESIZE];
++ char proc_path2[64+IF_NAMESIZE];
++ struct stat st;
++
++ snprintf(proc_path, sizeof(proc_path), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 6, "default");
++ snprintf(proc_path2, sizeof(proc_path2), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 4, "default");
++
++ if ((stat(proc_path, &st) == 0) || (stat(proc_path2, &st) == 0)) {
++ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS;
++ }
++ else {
++ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME;
++ retrans_time_factor = 10;
++ }
+ }
+
+ /*
+@@ -161,7 +181,7 @@ _arch_interface_flags_v4_get(netsnmp_int
+ /*
+ * get the retransmit time
+ */
+- snprintf(line,sizeof(line),"/proc/sys/net/ipv4/neigh/%s/retrans_time",
++ snprintf(line,sizeof(line),proc_sys_retrans_time, 4,
+ entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+@@ -169,7 +189,12 @@ _arch_interface_flags_v4_get(netsnmp_int
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+- entry->retransmit_v4 = atoi(line) * 100;
++ if (retrans_time_factor) {
++ entry->retransmit_v4 = atoi(line) * retrans_time_factor;
++ }
++ else {
++ entry->retransmit_v4 = atoi(line);
++ };
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT;
+ }
+ fclose(fin);
+@@ -191,7 +216,7 @@ _arch_interface_flags_v6_get(netsnmp_int
+ /*
+ * get the retransmit time
+ */
+- snprintf(line,sizeof(line),"/proc/sys/net/ipv6/neigh/%s/retrans_time",
++ snprintf(line,sizeof(line),proc_sys_retrans_time, 6,
+ entry->name);
+ if (!(fin = fopen(line, "r"))) {
+ DEBUGMSGTL(("access:interface",
+@@ -199,7 +224,12 @@ _arch_interface_flags_v6_get(netsnmp_int
+ }
+ else {
+ if (fgets(line, sizeof(line), fin)) {
+- entry->retransmit_v6 = atoi(line);
++ if (retrans_time_factor) {
++ entry->retransmit_v6 = atoi(line) * retrans_time_factor;
++ }
++ else {
++ entry->retransmit_v6 = atoi(line);
++ };
+ entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT;
+ }
+ fclose(fin);
+
+
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch b/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch
new file mode 100644
index 000000000000..389cd2bfd873
--- /dev/null
+++ b/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch
@@ -0,0 +1,233 @@
+Index: agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c
+===================================================================
+RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,v
+retrieving revision 1.5.2.1
+diff -u -p -u -r1.5.2.1 tcpConn_linux.c
+--- agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c 17 Aug 2006 08:52:15 -0000 1.5.2.1
++++ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c 1 Sep 2006 17:15:23 -0000
+@@ -169,11 +169,20 @@ _load4(netsnmp_container *container, u_i
+ break;
+ }
+
+- entry->loc_port = htons((unsigned short) local_port);
+- entry->rmt_port = htons((unsigned short) remote_port);
++ /** oddly enough, these appear to already be in network order */
++ entry->loc_port = (unsigned short) local_port;
++ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
++
++ /** the addr string may need work */
+ buf_len = strlen(local_addr);
+- netsnmp_assert(8 == buf_len);
++ if ((8 != buf_len) ||
++ (-1 == netsnmp_addrstr_hton(local_addr, 8))) {
++ DEBUGMSGT(("verbose:access:tcpconn:container",
++ " error processing local address\n"));
++ netsnmp_access_tcpconn_entry_free(entry);
++ continue;
++ }
+ offset = 0;
+ tmp_ptr = entry->loc_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+@@ -188,8 +197,15 @@ _load4(netsnmp_container *container, u_i
+ continue;
+ }
+
+- buf_len = strlen(remote_addr);
+- netsnmp_assert(8 == buf_len);
++ /** the addr string may need work */
++ buf_len = strlen((char*)remote_addr);
++ if ((8 != buf_len) ||
++ (-1 == netsnmp_addrstr_hton(remote_addr, 8))) {
++ DEBUGMSGT(("verbose:access:tcpconn:container",
++ " error processing remote address\n"));
++ netsnmp_access_tcpconn_entry_free(entry);
++ continue;
++ }
+ offset = 0;
+ tmp_ptr = entry->rmt_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+@@ -244,6 +260,8 @@ _load6(netsnmp_container *container, u_i
+ fgets(line, sizeof(line), in); /* skip header */
+
+ /*
++ * Note: PPC (big endian)
++ *
+ * sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode
+ * 0: 00000000000000000000000000000001:1466 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 500 0 326699 1 efb81580 3000 0 0 2 -1
+ */
+@@ -291,11 +309,20 @@ _load6(netsnmp_container *container, u_i
+ break;
+ }
+
+- entry->loc_port = htons((unsigned short) local_port);
+- entry->rmt_port = htons((unsigned short) remote_port);
++ /** oddly enough, these appear to already be in network order */
++ entry->loc_port = (unsigned short) local_port;
++ entry->rmt_port = (unsigned short) remote_port;
+ entry->tcpConnState = state;
+
+- buf_len = strlen(local_addr);
++ /** the addr string may need work */
++ buf_len = strlen((char*)local_addr);
++ if ((32 != buf_len) ||
++ (-1 == netsnmp_addrstr_hton(local_addr, 32))) {
++ DEBUGMSGT(("verbose:access:tcpconn:container",
++ " error processing local address\n"));
++ netsnmp_access_tcpconn_entry_free(entry);
++ continue;
++ }
+ offset = 0;
+ tmp_ptr = entry->loc_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+@@ -310,7 +337,14 @@ _load6(netsnmp_container *container, u_i
+ continue;
+ }
+
+- buf_len = strlen(remote_addr);
++ buf_len = strlen((char*)remote_addr);
++ if ((32 != buf_len) ||
++ (-1 == netsnmp_addrstr_hton(remote_addr, 32))) {
++ DEBUGMSGT(("verbose:access:tcpconn:container",
++ " error processing remote address\n"));
++ netsnmp_access_tcpconn_entry_free(entry);
++ continue;
++ }
+ offset = 0;
+ tmp_ptr = entry->rmt_addr;
+ rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len,
+Index: agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c
+===================================================================
+RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,v
+retrieving revision 1.2.2.1
+diff -u -p -u -r1.2.2.1 udp_endpoint_linux.c
+--- agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c 25 Jan 2006 16:27:40 -0000 1.2.2.1
++++ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c 1 Sep 2006 17:15:23 -0000
+@@ -112,9 +112,9 @@ _process_line_udp_ep(netsnmp_line_info *
+ struct netsnmp_line_process_info_s* lpi)
+ {
+ netsnmp_udp_endpoint_entry *ep = (netsnmp_udp_endpoint_entry *)mem;
+- char *ptr;
++ char *ptr, *sep;
+ u_char *u_ptr;
+- size_t u_ptr_len, offset;
++ size_t u_ptr_len, offset, len;
+
+ /*
+ * skip 'sl'
+@@ -135,10 +135,22 @@ _process_line_udp_ep(netsnmp_line_info *
+ /*
+ * get local address. ignore error on hex conversion, since that
+ * function doesn't like the ':' between address and port. check the
+- * offset to see if it worked.
++ * offset to see if it worked. May need to flip string too.
+ */
+ u_ptr = ep->loc_addr;
+ u_ptr_len = sizeof(ep->loc_addr);
++ sep = strchr(ptr, ':');
++ if (NULL == sep) {
++ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n",
++ line_info->start));
++ return PMLP_RC_MEMORY_UNUSED;
++ }
++ len = (sep - ptr);
++ if (-1 == netsnmp_addrstr_hton(ptr, len)) {
++ DEBUGMSGTL(("text:util:tvi", "bad length %d for loc addr '%s'\n",
++ u_ptr_len, line_info->start));
++ return PMLP_RC_MEMORY_UNUSED;
++ }
+ offset = 0;
+ netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL);
+ if ((4 != offset) && (16 != offset)) {
+@@ -159,14 +171,26 @@ _process_line_udp_ep(netsnmp_line_info *
+ /*
+ * get remote address. ignore error on hex conversion, since that
+ * function doesn't like the ':' between address and port. check the
+- * offset to see if it worked.
++ * offset to see if it worked. May need to flip string too.
+ */
+ u_ptr = ep->rmt_addr;
+ u_ptr_len = sizeof(ep->rmt_addr);
++ sep = strchr(ptr, ':');
++ if (NULL == sep) {
++ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n",
++ line_info->start));
++ return PMLP_RC_MEMORY_UNUSED;
++ }
++ len = (sep - ptr);
++ if (-1 == netsnmp_addrstr_hton(ptr, len)) {
++ DEBUGMSGTL(("text:util:tvi", "bad length %d for rmt addr '%s'\n",
++ u_ptr_len, line_info->start));
++ return PMLP_RC_MEMORY_UNUSED;
++ }
+ offset = 0;
+ netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL);
+ if ((4 != offset) && (16 != offset)) {
+- DEBUGMSGTL(("text:util:tvi", "bad offset %d for loc addr '%s'\n",
++ DEBUGMSGTL(("text:util:tvi", "bad offset %d for rmt addr '%s'\n",
+ offset, line_info->start));
+ return PMLP_RC_MEMORY_UNUSED;
+ }
+Index: include/net-snmp/library/tools.h
+===================================================================
+RCS file: /cvsroot/net-snmp/net-snmp/include/net-snmp/library/tools.h,v
+retrieving revision 5.8.2.2
+diff -u -p -u -r5.8.2.2 tools.h
+--- include/net-snmp/library/tools.h 13 Jun 2006 12:50:36 -0000 5.8.2.2
++++ include/net-snmp/library/tools.h 1 Sep 2006 17:15:24 -0000
+@@ -198,7 +198,9 @@ extern "C" {
+ int marker_tticks(marker_t pm);
+ int timeval_tticks(struct timeval *tv);
+ char *netsnmp_getenv(const char *name);
+-
++
++ int netsnmp_addrstr_hton(char *ptr, size_t len);
++
+ #ifdef __cplusplus
+ }
+ #endif
+Index: snmplib/tools.c
+===================================================================
+RCS file: /cvsroot/net-snmp/net-snmp/snmplib/tools.c,v
+retrieving revision 5.10.2.2
+diff -u -p -u -r5.10.2.2 tools.c
+--- snmplib/tools.c 25 Jul 2006 08:04:35 -0000 5.10.2.2
++++ snmplib/tools.c 1 Sep 2006 17:15:26 -0000
+@@ -1042,3 +1042,35 @@ char *netsnmp_getenv(const char *name)
+ #endif
+ }
+
++/*
++ * swap the order of an inet addr string
++ */
++int
++netsnmp_addrstr_hton(char *ptr, size_t len)
++{
++#ifndef WORDS_BIGENDIAN
++ char tmp[8];
++
++ if (8 == len) {
++ tmp[0] = ptr[6];
++ tmp[1] = ptr[7];
++ tmp[2] = ptr[4];
++ tmp[3] = ptr[5];
++ tmp[4] = ptr[2];
++ tmp[5] = ptr[3];
++ tmp[6] = ptr[0];
++ tmp[7] = ptr[1];
++ memcpy (ptr, &tmp, 8);
++ }
++ else if (32 == len) {
++ netsnmp_addrstr_hton(ptr , 8);
++ netsnmp_addrstr_hton(ptr+8 , 8);
++ netsnmp_addrstr_hton(ptr+16, 8);
++ netsnmp_addrstr_hton(ptr+24, 8);
++ }
++ else
++ return -1;
++#endif
++
++ return 0;
++}
+
+
diff --git a/net-analyzer/net-snmp/net-snmp-5.3.1-r1.ebuild b/net-analyzer/net-snmp/net-snmp-5.3.1-r1.ebuild
new file mode 100644
index 000000000000..936c910e3b2c
--- /dev/null
+++ b/net-analyzer/net-snmp/net-snmp-5.3.1-r1.ebuild
@@ -0,0 +1,188 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/net-snmp-5.3.1-r1.ebuild,v 1.1 2006/10/23 13:04:29 mattm Exp $
+
+inherit fixheadtails flag-o-matic perl-module
+
+DESCRIPTION="Software for generating and retrieving SNMP data"
+HOMEPAGE="http://net-snmp.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="as-is BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="diskio doc elf ipv6 lm_sensors mfd-rewrites minimal perl rpm selinux smux ssl tcpd X"
+
+DEPEND=">=sys-libs/zlib-1.1.4
+ ssl? ( >=dev-libs/openssl-0.9.6d )
+ tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
+ rpm? ( app-arch/rpm
+ dev-libs/popt
+ app-arch/bzip2
+ )
+ elf? ( dev-libs/elfutils )
+ lm_sensors? ( sys-apps/lm_sensors )"
+
+RDEPEND="${DEPEND}
+ perl? (
+ X? ( dev-perl/perl-tk )
+ !minimal? ( dev-perl/TermReadKey )
+ )
+ selinux? ( sec-policy/selinux-snmpd )"
+
+DEPEND="${DEPEND}
+ >=sys-apps/sed-4
+ doc? ( app-doc/doxygen )"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+# The lm_sensors patch has a memory leak
+# If you can help, please attach a patch to bug 109785
+
+# if use lm_sensors; then
+# if use x86 || use amd64; then
+# epatch "${FILESDIR}"/${PN}-lm_sensors.patch
+# else
+# eerror "Unfortunatly you are trying to enable lm_sensors support for an unsupported arch."
+# eerror "please check the availability of sys-apps/lm_sensors - if it is available on"
+# eerror "your arch, please file a bug about this."
+# die "lm_sensors patch error: unsupported arch."
+# fi
+# fi
+
+# RedHat Patches to generally fix x86_64 type issues
+ epatch "${FILESDIR}"/${PN}-5.3.1-retrans-time.patch
+ epatch "${FILESDIR}"/${PN}-5.3.1-tcp-udp-mib-byteorder.patch
+
+
+ # bugs 68467 and 68254
+ sed -i -e \
+ 's/^NSC_AGENTLIBS="@AGENTLIBS@"/NSC_AGENTLIBS="@AGENTLIBS@ @WRAPLIBS@"/' \
+ net-snmp-config.in || die "sed net-snmp-config.in"
+ sed -i -e 's;embed_perl="yes",;embed_perl=$enableval,;' configure.in \
+ || die "sed configure.in failed"
+ # Insecure run-path - bug 103776
+ sed -i -e 's/\(@(cd perl ; $(MAKE)\)\() ; \\\)/\1 LD_RUN_PATH=\2/g' \
+ Makefile.in || die "sed Makefile.in failed"
+ # fix access violation in make check
+ sed -i -e 's/\(snmpd.*\)-Lf/\1-l/' testing/eval_tools.sh || \
+ die "sed eval_tools.sh failed"
+ # fix path in fixproc
+ sed -i -e 's|\(database_file =.*\)/local\(.*\)$|\1\2|' local/fixproc || \
+ die "sed fixproc failed"
+
+ ht_fix_all
+}
+
+src_compile() {
+ local mibs
+
+ strip-flags
+
+ autoconf || die "autoconf failed"
+
+ mibs="host ucd-snmp/dlmod"
+ use smux && mibs="${mibs} smux"
+ use lm_sensors && mibs="${mibs} ucd-snmp/lmSensors"
+ use diskio && mibs="${mibs} ucd-snmp/diskio"
+
+ econf \
+ --with-install-prefix="${D}" \
+ --with-sys-location="Unknown" \
+ --with-sys-contact="root@Unknown" \
+ --with-default-snmp-version="3" \
+ --with-mib-modules="${mibs}" \
+ --with-logfile="${ROOT}/var/log/net-snmpd.log" \
+ --with-persistent-directory="${ROOT}/var/lib/net-snmp" \
+ --enable-ucd-snmp-compatibility \
+ --enable-shared \
+ --with-zlib \
+ $(use_enable mfd-rewrites) \
+ $(use_enable perl embedded-perl) \
+ $(use_enable ipv6) \
+ $(use_enable !ssl internal-md5) \
+ $(use_with ssl openssl) \
+ $(use_with tcpd libwrap) \
+ $(use_with rpm) \
+ $(use_with rpm bzip2) \
+ $(use_with elf) \
+ || die "econf failed"
+
+ emake -j1 || die "emake failed"
+
+ if use perl ; then
+ emake perlmodules || die "compile perl modules problem"
+ fi
+
+ if use doc ; then
+ einfo "Building HTML Documentation"
+ make docsdox || die "failed to build docs"
+ fi
+}
+
+src_test() {
+ cd testing
+ if ! make test ; then
+ echo
+ einfo "Don't be alarmed if a few tests FAIL."
+ einfo "This could happen for several reasons:"
+ einfo " - You don't already have a working configuration."
+ einfo " - Your ethernet interface isn't properly configured."
+ echo
+ fi
+}
+
+src_install () {
+ make DESTDIR="${D}" install || die "make install failed"
+
+ if use perl ; then
+ make DESTDIR="${D}" perlinstall || die "make perlinstall failed"
+ fixlocalpod
+
+ use X || rm -f "${D}/usr/bin/tkmib"
+ else
+ rm -f "${D}/usr/bin/mib2c" "${D}/usr/bin/tkmib"
+ fi
+
+ dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO
+ newdoc EXAMPLE.conf.def EXAMPLE.conf
+
+ use doc && dohtml docs/html/*
+
+ keepdir /etc/snmp /var/lib/net-snmp
+
+ newinitd "${FILESDIR}"/snmpd-5.1.rc6 snmpd || die
+ newconfd "${FILESDIR}"/snmpd-5.1.conf snmpd || die
+
+ # snmptrapd can use the same rc script just slightly modified
+ sed -e 's/net-snmpd/snmptrapd/g' \
+ -e 's/snmpd/snmptrapd/g' \
+ -e 's/SNMPD/SNMPTRAPD/g' \
+ "${D}"/etc/init.d/snmpd > "${D}"/etc/init.d/snmptrapd || \
+ die "failed to create snmptrapd init script"
+ chmod 0755 "${D}"/etc/init.d/snmptrapd
+
+ newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd || die
+
+ # Remove everything, keeping only the snmpd, snmptrapd, MIBs, libs, and includes.
+ if use minimal; then
+ einfo "USE=minimal is set. Cleaning up excess cruft for a embedded/minimal/server only install."
+ rm -rf "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform}}
+ rm -rf "${D}"/usr/share/snmp/snmpconf-data "${D}"/usr/share/snmp/*.conf
+ rm -rf "${D}"/usr/bin/{fixproc,traptoemail} "${D}"/usr/bin/snmpc{heck,onf}
+ find "${D}" -name '*.pl' -exec rm -f '{}' \;
+ use ipv6 || rm -rf "${D}"/usr/share/snmp/mibs/IPV6*
+ fi
+
+ # bug 113788, install example config
+ insinto /etc/snmp
+ newins "${S}"/EXAMPLE.conf snmpd.conf.example
+}
+
+pkg_postinst() {
+ einfo "An example configuration file has been installed in"
+ einfo "/etc/snmp/snmpd.conf.example."
+}
+