rpms/libdhcp/F-8 libdhcp-1.27-libnl.patch, NONE, 1.1 libdhcp.spec, 1.60, 1.61

David Cantrell (dcantrel) fedora-extras-commits at redhat.com
Fri Jan 4 04:57:34 UTC 2008


Author: dcantrel

Update of /cvs/pkgs/rpms/libdhcp/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29922

Modified Files:
	libdhcp.spec 
Added Files:
	libdhcp-1.27-libnl.patch 
Log Message:
* Thu Jan 03 2008 David Cantrell <dcantrell at redhat.com> - 1.27-4
- Patch nic.c for libnl API changes


libdhcp-1.27-libnl.patch:

--- NEW FILE libdhcp-1.27-libnl.patch ---
diff -up libdhcp-1.27/nic.c.nl libdhcp-1.27/nic.c
--- libdhcp-1.27/nic.c.nl	2007-08-10 11:12:31.000000000 -1000
+++ libdhcp-1.27/nic.c	2008-01-03 18:44:14.000000000 -1000
@@ -45,7 +45,6 @@
 
 #include <netlink/netlink.h>
 #include <netlink/netlink-kernel.h>
-#include <netlink/rtnetlink-kernel.h>
 #include <netlink/msg.h>
 #include <netlink/attr.h>
 #include <netlink/utils.h>
@@ -329,15 +328,17 @@ static int nic_get_links(NLH_t nh, char 
         }
     }
 
-    if (nl_send_auto_complete(nh->nl, nlmsg_hdr(msg)) < 0) {
+    if (nl_send_auto_complete(nh->nl, msg) < 0) {
         eprintf(NIC_FATAL, "nic_get_links: %m\n");
         return -1;
     }
 
     rlen = 1;
     while (rlen > 0) {
+	struct ucred *creds = NULL;
+
         rhdrs = NULL;
-        if ((rlen = nl_recv(nh->nl, &addr, (void *)&rhdrs)) <= 0)
+        if ((rlen = nl_recv(nh->nl, &addr, (void *)&rhdrs, &creds)) <= 0)
             break;
 
         if (rlen < sizeof (*rhdr) + sizeof (struct ifinfomsg)) {
@@ -685,13 +686,14 @@ NIC_Res_t nic_update(NIC_t nic) {
     if (nic->l.change & NIC_LINK_PROTINFO)
         NLA_PUT_U32(msg, IFLA_PROTINFO, nic->l.protinfo);
 
-    if (nl_send_auto_complete(nic->nh->nl, nlmsg_hdr(msg)) < 0) {
+    if (nl_send_auto_complete(nic->nh->nl, msg) < 0) {
         eprintf(NIC_ERR,"nic_update_link: send failed - %d %s",
                 nl_get_errno(), nl_geterror());
         return NIC_FAIL;
     }
 
     nlmsg_free(msg);
+    nl_disable_sequence_check(nic->nh->nl);
 
     if (nl_wait_for_ack(nic->nh->nl) < 0) {
         eprintf(NIC_ERR,"nic_update_link failed - %d: %s",
@@ -1014,7 +1016,7 @@ static int nic_get_addresses(NLH_t nh, I
         NLA_PUT(msg, IFLA_ADDRESS, IP_ADDR_SIZE(&(addr->nla.addr)),
                 IP_ADDR(&(addr->nla.addr)));
 
-    if (nl_send_auto_complete( nh->nl, nlmsg_hdr(msg) ) < 0) {
+    if (nl_send_auto_complete( nh->nl, msg) < 0) {
         eprintf(NIC_ERR,"nic_get_addresses: send failed: %d %s\n",
                 nl_get_errno(), nl_geterror());
         goto nla_put_failure;
@@ -1033,7 +1035,8 @@ static int nic_get_addresses(NLH_t nh, I
     int remaining = 0;
 
     do {
-        if ((rlen = nl_recv(nh->nl, &kernel, (void*) &buf)) > 0) {
+	struct ucred *creds = NULL;
+        if ((rlen = nl_recv(nh->nl, &kernel, (void*) &buf, &creds)) > 0) {
             if (rlen < (sizeof(struct nlmsghdr) + sizeof(struct ifaddrmsg)))
                 goto nla_return;
 
@@ -1506,13 +1509,14 @@ static int nic_addr_send(IPaddr_t ipa, N
     if (ipa->nla.have & NIC_ADDR_CACHEINFO)
         NLA_PUT(msg, IFA_CACHEINFO, sizeof(struct ifa_cacheinfo), &(ipa->nla.cacheinfo));
 
-    if ((err = nl_send_auto_complete(ipa->nh->nl, nlmsg_hdr(msg))) < 0) {
+    if ((err = nl_send_auto_complete(ipa->nh->nl, msg)) < 0) {
         eprintf(NIC_ERR,"nic_addr_send: send failed - %d %d %s",
                 err, nl_get_errno(), nl_geterror());
         return NIC_FAIL;
     }
 
     nlmsg_free(msg);
+    nl_disable_sequence_check(ipa->nh->nl);
 
     int n_tries = 0;
 
@@ -1871,7 +1875,7 @@ static int nic_get_routes(NLH_t nh, RT_t
     if ((rta->have & NIC_RT_IIF) && (rta->iif[0] != '\0'))
         NLA_PUT_STRING(msg, RTA_IIF, &(rta->iif[0]));
 
-    if (nl_send_auto_complete(nh->nl, nlmsg_hdr(msg)) < 0) {
+    if (nl_send_auto_complete(nh->nl, msg) < 0) {
         eprintf(NIC_ERR, "nic_get_routes: send failed: %d %s\n",
                 nl_get_errno(), nl_geterror());
         goto nla_put_failure;
@@ -1884,7 +1888,8 @@ static int nic_get_routes(NLH_t nh, RT_t
     int remaining = 0;
 
     do {
-        if ((rlen = nl_recv(nh->nl, &kernel, (void*) &buf)) > 0) {
+	struct ucred *creds = NULL;
+        if ((rlen = nl_recv(nh->nl, &kernel, (void*) &buf, &creds)) > 0) {
             if (rlen < (sizeof(struct nlmsghdr) + sizeof(struct rtmsg)))
                 goto rta_return;
 
@@ -2518,13 +2523,14 @@ static NIC_Res_t nic_route_msg(IProute_t
     if (rt->rt.have & NIC_RT_MP_ALGO)
         NLA_PUT_U32(msg, RTA_MP_ALGO, rt->rt.mp_algo);
 
-    if (nl_send_auto_complete(rt->nh->nl, nlmsg_hdr(msg)) < 0) {
+    if (nl_send_auto_complete(rt->nh->nl, msg) < 0) {
         eprintf(NIC_ERR, "%s: send failed - %d %s", tag, nl_get_errno(),
                 nl_geterror());
         return NIC_FAIL;
     }
 
     nlmsg_free(msg);
+    nl_disable_sequence_check(rt->nh->nl);
 
     if (nl_wait_for_ack(rt->nh->nl) < 0) {
         eprintf(NIC_ERR, "%s: failed - %d: %s", tag, nl_get_errno(),


Index: libdhcp.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libdhcp/F-8/libdhcp.spec,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- libdhcp.spec	19 Sep 2007 15:09:00 -0000	1.60
+++ libdhcp.spec	4 Jan 2008 04:56:57 -0000	1.61
@@ -1,12 +1,13 @@
 Summary: A library for network interface configuration with DHCP
 Name:    libdhcp
 Version: 1.27
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2+
 Group:   Development/Libraries
 URL:     http://dcantrel.fedorapeople.org/%{name}
 
 Source:  http://dcantrel.fedorapeople.org/%{name}/%{name}-%{version}.tar.bz2
+Patch0:  %{name}-1.27-libnl.patch
 
 BuildRoot:  %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: dhcp-devel, libdhcp4client-devel >= 12:3.0.4-18
@@ -40,6 +41,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__make} %{?_smp_mflags}
@@ -71,6 +73,9 @@
 %{_libdir}/libdhcp.a
 
 %changelog
+* Thu Jan 03 2008 David Cantrell <dcantrell at redhat.com> - 1.27-4
+- Patch nic.c for libnl API changes
+
 * Wed Sep 19 2007 David Cantrell <dcantrell at redhat.com> - 1.27-3
 - static package Requires libdhcp6client-static
 




More information about the fedora-extras-commits mailing list