[Pkg-net-snmp-commits] [pkg-net-snmp] 01/01: fix Bug#745919 and Bug#745956
Hideki Yamane
henrich at moszumanska.debian.org
Sun Apr 27 08:15:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
henrich pushed a commit to branch master
in repository pkg-net-snmp.
commit ff641895521fd90599bb8392c0d621f33cdfb55e
Author: Hideki Yamane <henrich at debian.org>
Date: Sun Apr 27 17:08:30 2014 +0900
fix Bug#745919 and Bug#745956
---
debian/changelog | 9 +++++++
debian/patches/ifmib.patch | 62 ++++++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 72 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 1b71bb6..b144599 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+net-snmp (5.7.2.1~dfsg-5) unstable; urgency=high
+
+ * debian/patches
+ - add ifmib.patch taken from upstream to work on systems without a PCI bus
+ Thanks to Chris Boot <debian at bootc.net> and Sergey Dorofeev
+ <sergey at fidoman.ru> for the report (Closes: #745919, #745956)
+
+ -- Hideki Yamane <henrich at debian.org> Sun, 27 Apr 2014 17:05:08 +0900
+
net-snmp (5.7.2.1~dfsg-4) unstable; urgency=medium
* debian/*.init
diff --git a/debian/patches/ifmib.patch b/debian/patches/ifmib.patch
new file mode 100644
index 0000000..0204f8a
--- /dev/null
+++ b/debian/patches/ifmib.patch
@@ -0,0 +1,62 @@
+diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c
+index 3419811..d6eb91a 100644
+--- a/agent/mibgroup/if-mib/data_access/interface_linux.c
++++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
+@@ -18,7 +18,31 @@ netsnmp_feature_require(interface_ioctl_flags_set)
+
+ #ifdef HAVE_PCI_LOOKUP_NAME
+ #include <pci/pci.h>
++#include <setjmp.h>
+ static struct pci_access *pci_access;
++
++/* Avoid letting libpci call exit(1) when no PCI bus is available. */
++static int do_longjmp =0;
++static jmp_buf err_buf;
++static void
++netsnmp_pci_error(char *msg, ...)
++{
++ va_list args;
++ char *buf;
++ int buflen;
++
++ va_start(args, msg);
++ buflen = strlen("pcilib: ")+strlen(msg)+2;
++ buf = malloc(buflen);
++ snprintf(buf, buflen, "pcilib: %s\n", msg);
++ snmp_vlog(LOG_ERR, buf, args);
++ free(buf);
++ va_end(args);
++ if (do_longjmp)
++ longjmp(err_buf, 1);
++ else
++ exit(1);
++}
+ #endif
+
+ #ifdef HAVE_LINUX_ETHTOOL_H
+@@ -147,10 +171,22 @@ netsnmp_arch_interface_init(void)
+
+ #ifdef HAVE_PCI_LOOKUP_NAME
+ pci_access = pci_alloc();
+- if (pci_access)
++ if (!pci_access) {
++ snmp_log(LOG_ERR, "pcilib: pci_alloc failed\n");
++ return;
++ }
++
++ pci_access->error = netsnmp_pci_error;
++
++ do_longjmp = 1;
++ if (setjmp(err_buf)) {
++ pci_cleanup(pci_access);
++ snmp_log(LOG_ERR, "pcilib: pci_init failed\n");
++ pci_access = NULL;
++ }
++ else if (pci_access)
+ pci_init(pci_access);
+- else
+- snmp_log(LOG_ERR, "Unable to create pci access method\n");
++ do_longjmp = 0;
+ #endif
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
index 6a2634c..9f7bc2d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -23,3 +23,4 @@ add_rocommunity6.patch
fix_manpage-has-errors-from-man.patch
agentx-crash.patch
TrapReceiver.patch
+ifmib.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-net-snmp/pkg-net-snmp.git
More information about the Pkg-net-snmp-commits
mailing list