[packages/libnl] added old_kernel.patch; rel. 3

sls sls at pld-linux.org
Tue Jun 3 22:08:11 CEST 2014


commit 6640a0a8deb3dcbb83997f188f4277afcfc2ddc2
Author: Szymon Siwek <sls at pld-linux.org>
Date:   Tue Jun 3 20:02:56 2014 +0000

    added old_kernel.patch; rel. 3
    
    - libnl issue #56 (https://github.com/thom311/libnl/issues/56):
      "Older kernels don't accept receiving unknown netlink attributes."
      (old kernel + new libnl ==> NetworkManager doesn't work)

 libnl.spec        |  4 +++-
 old_kernels.patch | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/libnl.spec b/libnl.spec
index 83e4bec..5e47bc6 100644
--- a/libnl.spec
+++ b/libnl.spec
@@ -7,7 +7,7 @@ Summary:	Netlink sockets library
 Summary(pl.UTF-8):	Biblioteka do obsługi gniazd netlink
 Name:		libnl
 Version:	3.2.24
-Release:	2
+Release:	3
 Epoch:		1
 License:	LGPL v2.1
 Group:		Libraries
@@ -17,6 +17,7 @@ Source1:	http://www.infradead.org/~tgr/libnl/files/%{name}-doc-%{version}.tar.gz
 # Source1-md5:	d1111959652bd6ad87b2071f61c8c20c
 Patch0:		%{name}-link.patch
 Patch1:		%{name}-pedantic.patch
+Patch2:		old_kernels.patch
 URL:		http://www.infradead.org/~tgr/libnl/
 BuildRequires:	autoconf >= 2.50
 BuildRequires:	automake
@@ -111,6 +112,7 @@ Pythonowy interfejs do protokołów netlink.
 mv -f libnl-doc-%{version} doc
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
diff --git a/old_kernels.patch b/old_kernels.patch
new file mode 100644
index 0000000..690a13c
--- /dev/null
+++ b/old_kernels.patch
@@ -0,0 +1,25 @@
+diff --git a/lib/route/addr.c b/lib/route/addr.c
+index 97905f0..e6e91d2 100644
+--- a/lib/route/addr.c
++++ b/lib/route/addr.c
+@@ -598,7 +598,19 @@ static int build_addr_msg(struct rtnl_addr *tmpl, int cmd, int flags,
+ 		NLA_PUT(msg, IFA_CACHEINFO, sizeof(ca), &ca);
+ 	}
+ 
+-	NLA_PUT_U32(msg, IFA_FLAGS, tmpl->a_flags);
++	if (tmpl->a_flags & ~0xFF) {
++		/* only set the IFA_FLAGS attribute, if they actually contain additional
++		 * flags that are not already set to am.ifa_flags.
++		 *
++		 * Older kernels refuse RTM_NEWADDR and RTM_NEWROUTE messages with EINVAL
++		 * if they contain unknown netlink attributes. See net/core/rtnetlink.c, which
++		 * was fixed by kernel commit 661d2967b3f1b34eeaa7e212e7b9bbe8ee072b59.
++		 *
++		 * With this workaround, libnl will function correctly with older kernels,
++		 * unless there is a new libnl user that wants to set these flags. In this
++		 * case it's up to the user to workaround this issue. */
++		NLA_PUT_U32(msg, IFA_FLAGS, tmpl->a_flags);
++	}
+ 
+ 	*result = msg;
+ 	return 0;
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libnl.git/commitdiff/6640a0a8deb3dcbb83997f188f4277afcfc2ddc2



More information about the pld-cvs-commit mailing list