summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-11-11 11:18:37 +0200
committerTimo Teräs <timo.teras@iki.fi>2011-11-11 11:18:37 +0200
commitac22212e8d4e2af30b3a2a2c898ae4664ea796f6 (patch)
tree3a57548a2367592fa3bcddcf8d64320e004488be
parent0389c0810effbe38de6d05d68e3ab6bb08a8aaef (diff)
main/net-snmp: add some snmpd MIB implementation fixes
* IP-MIB::ipNetToPhysicalPhysAddress is fixed to display data properly even after first time * swinst patch prevents a crash during snmpwalk in default install
-rw-r--r--main/net-snmp/APKBUILD20
-rw-r--r--main/net-snmp/netsnmp-arp-netlink-fix.patch19
-rw-r--r--main/net-snmp/netsnmp-swinst-crash.patch12
3 files changed, 50 insertions, 1 deletions
diff --git a/main/net-snmp/APKBUILD b/main/net-snmp/APKBUILD
index 6968721dcd3..3928e0b962e 100644
--- a/main/net-snmp/APKBUILD
+++ b/main/net-snmp/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=net-snmp
pkgver=5.7.1
-pkgrel=0
+pkgrel=1
pkgdesc="Simple Network Management Protocol"
url="http://www.net-snmp.org/"
arch="all"
@@ -12,6 +12,8 @@ depends_dev="openssl-dev"
makedepends="perl-dev openssl-dev"
subpackages="$pkgname-doc $pkgname-dev $pkgname-tools"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
+ netsnmp-arp-netlink-fix.patch
+ netsnmp-swinst-crash.patch
snmpd.initd
snmpd.confd
snmptrapd.initd
@@ -20,6 +22,20 @@ source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ local i
+ cd "$_builddir"
+ # patches goes here
+ for i in $source; do
+ case $i in
+ *.patch|*.diff)
+ msg "Applying $i..."
+ patch -p1 -i "$srcdir"/$i || return 1
+ ;;
+ esac
+ done
+}
+
build() {
cd "$_builddir"
@@ -69,6 +85,8 @@ tools() {
md5sums="c95d08fd5d93df0c11a2e1bdf0e01e0b net-snmp-5.7.1.tar.gz
+58bdd8a68042be16c22d8b4b40d3ec9c netsnmp-arp-netlink-fix.patch
+bd7dc10ffb5839e35ec37effcc53c2ad netsnmp-swinst-crash.patch
198a4a7b80557fa8112394df5ec9914e snmpd.initd
96510a2f3bc9f21648b03f7e8d76c0d3 snmpd.confd
7ce3e9e880fc6313ae87eb000bae4bda snmptrapd.initd
diff --git a/main/net-snmp/netsnmp-arp-netlink-fix.patch b/main/net-snmp/netsnmp-arp-netlink-fix.patch
new file mode 100644
index 00000000000..269f509da91
--- /dev/null
+++ b/main/net-snmp/netsnmp-arp-netlink-fix.patch
@@ -0,0 +1,19 @@
+--- net-snmp-5.7.1/agent/mibgroup/ip-mib/data_access/arp_netlink.c
++++ /home/fabled//net-snmp-5.7.1.patched/agent/mibgroup/ip-mib/data_access/arp_netlink.c
+@@ -43,7 +43,7 @@
+ if (cache_timeout != NULL)
+ *cache_timeout = 5;
+ if (cache_flags != NULL)
+- *cache_flags |= NETSNMP_CACHE_RESET_TIMER_ON_USE;
++ *cache_flags |= NETSNMP_CACHE_RESET_TIMER_ON_USE | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD;
+ access->cache_expired = cache_expired;
+
+ DEBUGMSGTL(("access:netlink:arp", "create arp cache\n"));
+@@ -131,6 +131,7 @@
+ unregister_readfd(fd);
+ close(fd);
+ access->arch_magic = NULL;
++ access->synchronized = 0;
+ }
+ return 0;
+ }
diff --git a/main/net-snmp/netsnmp-swinst-crash.patch b/main/net-snmp/netsnmp-swinst-crash.patch
new file mode 100644
index 00000000000..5502ddb28af
--- /dev/null
+++ b/main/net-snmp/netsnmp-swinst-crash.patch
@@ -0,0 +1,12 @@
+--- net-snmp-5.7.1/agent/mibgroup/host/data_access/swinst_pkginfo.c
++++ /home/fabled//net-snmp-5.7.1.patched/agent/mibgroup/host/data_access/swinst_pkginfo.c
+@@ -140,7 +140,8 @@
+ memcpy( entry->swDate, cp, date_len );
+ entry->swDate_len = date_len;
+ }
+- closedir( d );
++ if (d != NULL)
++ closedir( d );
+
+ DEBUGMSGTL(("swinst:load:arch"," loaded %d entries\n",
+ (int)CONTAINER_SIZE(container)));