[arch-commits] Commit in net-snmp/trunk (PKGBUILD libnl-2.patch)

Thomas Bächler thomas at archlinux.org
Sun Jan 16 14:22:47 UTC 2011


    Date: Sunday, January 16, 2011 @ 09:22:46
  Author: thomas
Revision: 106295

Rebuild for libnl 2

Added:
  net-snmp/trunk/libnl-2.patch
Modified:
  net-snmp/trunk/PKGBUILD

---------------+
 PKGBUILD      |    9 +++++--
 libnl-2.patch |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-16 14:20:04 UTC (rev 106294)
+++ PKGBUILD	2011-01-16 14:22:46 UTC (rev 106295)
@@ -4,7 +4,7 @@
 
 pkgname=net-snmp
 pkgver=5.5
-pkgrel=7
+pkgrel=8
 pkgdesc="A suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6"
 arch=('i686' 'x86_64')
 url="http://www.net-snmp.org/"
@@ -15,12 +15,15 @@
 provides=('ucd-snmp')
 options=('!libtool' '!makeflags' '!emptydirs')
 source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz"
-	'snmpd.rc')
+	'snmpd.rc'
+	'libnl-2.patch')
 md5sums=('5b2551e7bd024fbbee84dca22a5f13a1'
-         '9f0d13676ba1fae1eb7eb178edd85b43')
+         '9f0d13676ba1fae1eb7eb178edd85b43'
+         '63682a7ad84d1f46291404c5d6bca4f7')
 
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
+  patch -p1 -i "${srcdir}"/libnl-2.patch
   for _manpages in snmp_api_errstring.3 snmp_close.3 snmp_error.3 snmp_free_pdu.3 \
       snmp_open.3 snmp_perror.3 snmp_read.3 snmp_select_info.3 snmp_send.3 \
       snmp_sess_perror.3 snmp_timeout.3 ; do

Added: libnl-2.patch
===================================================================
--- libnl-2.patch	                        (rev 0)
+++ libnl-2.patch	2011-01-16 14:22:46 UTC (rev 106295)
@@ -0,0 +1,67 @@
+diff -Nur net-snmp-5.5.orig//agent/mibgroup/mibII/tcpTable.c net-snmp-5.5//agent/mibgroup/mibII/tcpTable.c
+--- net-snmp-5.5.orig//agent/mibgroup/mibII/tcpTable.c	2009-06-13 04:02:02.000000000 +0200
++++ net-snmp-5.5//agent/mibgroup/mibII/tcpTable.c	2011-01-15 10:31:03.579735957 +0100
+@@ -555,8 +555,10 @@
+ static int
+ tcpTable_load_netlink()
+ {
++        int err;
++
+ 	/*  TODO: perhaps use permanent nl handle? */
+-	struct nl_handle *nl = nl_handle_alloc();
++	struct nl_sock *nl = nl_socket_alloc();
+ 
+ 	if (nl == NULL) {
+ 		DEBUGMSGTL(("mibII/tcpTable", "Failed to allocate netlink handle\n"));
+@@ -564,10 +566,10 @@
+ 		return -1;
+ 	}
+ 
+-	if (nl_connect(nl, NETLINK_INET_DIAG) < 0) {
+-		DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror()));
+-		snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror());
+-		nl_handle_destroy(nl);
++	if ((err = nl_connect(nl, NETLINK_INET_DIAG)) < 0) {
++		DEBUGMSGTL(("mibII/tcpTable", "Failed to connect to netlink: %s\n", nl_geterror(err)));
++		snmp_log(LOG_ERR, "snmpd: Couldn't connect to netlink: %s\n", nl_geterror(err));
++		nl_socket_free(nl);
+ 		return -1;
+ 	}
+ 
+@@ -579,10 +581,10 @@
+ 	struct nl_msg *nm = nlmsg_alloc_simple(TCPDIAG_GETSOCK, NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST);
+ 	nlmsg_append(nm, &req, sizeof(struct inet_diag_req), 0);
+ 
+-	if (nl_send_auto_complete(nl, nm) < 0) {
+-		DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror()));
+-		snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror());
+-		nl_handle_destroy(nl);
++	if ((err = nl_send_auto_complete(nl, nm)) < 0) {
++		DEBUGMSGTL(("mibII/tcpTable", "nl_send_autocomplete(): %s\n", nl_geterror(err)));
++		snmp_log(LOG_ERR, "snmpd: nl_send_autocomplete(): %s\n", nl_geterror(err));
++		nl_socket_free(nl);
+ 		return -1;
+ 	}
+ 	nlmsg_free(nm);
+@@ -593,9 +595,9 @@
+ 
+ 	while (running) {
+ 		if ((len = nl_recv(nl, &peer, &buf, NULL)) <= 0) {
+-			DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror()));
+-			snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror());
+-			nl_handle_destroy(nl);
++			DEBUGMSGTL(("mibII/tcpTable", "nl_recv(): %s\n", nl_geterror(len)));
++			snmp_log(LOG_ERR, "snmpd: nl_recv(): %s\n", nl_geterror(len));
++			nl_socket_free(nl);
+ 			return -1;
+ 		}
+ 
+@@ -644,7 +646,7 @@
+ 		free(buf);
+ 	}
+ 
+-	nl_handle_destroy(nl);
++	nl_socket_free(nl);
+ 
+ 	if (tcp_head) {
+ 		DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table using netlink\n"));




More information about the arch-commits mailing list