Author: arekm                        Date: Sun Mar 27 21:12:40 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 3; port to libnl 3.0 api

---- Files affected:
packages/net-snmp:
   net-snmp.spec (1.173 -> 1.174) , net-snmp-libnl.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/net-snmp/net-snmp.spec
diff -u packages/net-snmp/net-snmp.spec:1.173 
packages/net-snmp/net-snmp.spec:1.174
--- packages/net-snmp/net-snmp.spec:1.173       Sun Mar 27 20:40:21 2011
+++ packages/net-snmp/net-snmp.spec     Sun Mar 27 23:12:35 2011
@@ -29,7 +29,7 @@
 Summary(uk.UTF-8):     Набір утиліт для протоколу SNMP від UC-Davis
 Name:          net-snmp
 Version:       5.6.1
-Release:       2
+Release:       3
 License:       BSD-like
 Group:         Networking/Daemons
 Source0:       
http://downloads.sourceforge.net/net-snmp/%{name}-%{version}.tar.gz
@@ -56,12 +56,13 @@
 Patch11:       %{name}-defaultconfig.patch
 Patch12:       %{name}-use-rpm-hrmib.patch
 Patch13:       %{name}-TCP_STATS_CACHE_TIMEOUT.patch
+Patch14:       %{name}-libnl.patch
 URL:           http://www.net-snmp.org/
 BuildRequires: autoconf >= 2.63
 BuildRequires: automake
 BuildRequires: elfutils-devel
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
-BuildRequires: libnl-devel >= 1:1.1
+BuildRequires: libnl-devel >= 1:3.0
 BuildRequires: libtool >= 1.4
 BuildRequires: libwrap-devel
 %{?with_lm_sensors:BuildRequires:      lm_sensors-devel >= 3.0.1}
@@ -430,6 +431,7 @@
 %patch11 -p1
 %patch12 -p1
 %patch13 -p1
+%patch14 -p1
 
 %build
 %{__libtoolize}
@@ -805,6 +807,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.174  2011/03/27 21:12:35  arekm
+- rel 3; port to libnl 3.0 api
+
 Revision 1.173  2011/03/27 18:40:21  arekm
 - release 2
 

================================================================
Index: packages/net-snmp/net-snmp-libnl.patch
diff -u /dev/null packages/net-snmp/net-snmp-libnl.patch:1.1
--- /dev/null   Sun Mar 27 23:12:40 2011
+++ packages/net-snmp/net-snmp-libnl.patch      Sun Mar 27 23:12:35 2011
@@ -0,0 +1,65 @@
+--- net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c.org 2011-03-27 
22:39:13.428728506 +0200
++++ net-snmp-5.6.1/agent/mibgroup/mibII/tcpTable.c     2011-03-27 
22:39:47.606956561 +0200
+@@ -555,8 +555,9 @@
+ static int
+ tcpTable_load_netlink(void)
+ {
++      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 +565,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_close(nl);
+               return -1;
+       }
+ 
+@@ -579,10 +580,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_close(nl);
+               return -1;
+       }
+       nlmsg_free(nm);
+@@ -593,9 +594,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_close(nl);
+                       return -1;
+               }
+ 
+@@ -644,7 +645,7 @@
+               free(buf);
+       }
+ 
+-      nl_handle_destroy(nl);
++      nl_close(nl);
+ 
+       if (tcp_head) {
+               DEBUGMSGTL(("mibII/tcpTable", "Loaded TCP Table using 
netlink\n"));
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/net-snmp/net-snmp.spec?r1=1.173&r2=1.174&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to