From fb6876a670479efe23b6cba8301923df63700c51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
Date: Wed, 9 Nov 2016 13:28:13 +0100
Subject: Fix nlmsgerr length check
---
...et-Netlink-0.04-Fix-nlmsgerr-length-check.patch | 41 ++++++++++++++++++++++
perl-Socket-Netlink.spec | 8 ++++-
2 files changed, 48 insertions(+), 1 deletion(-)
create mode 100644 Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
diff --git a/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
b/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
new file mode 100644
index 0000000..e554ea2
--- /dev/null
+++ b/Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
@@ -0,0 +1,41 @@
+From 01a86755a7d1ac97b1218ffe43ae8d1a8fdc4aab Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar(a)redhat.com>
+Date: Wed, 9 Nov 2016 10:42:23 +0100
+Subject: [PATCH] Fix nlmsgerr length check
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+There was a wrong boolean expression reported by a GCC warning:
+
+lib/Socket/Netlink.xs: In function 'XS_Socket__Netlink_unpack_nlmsgerr':
+lib/Socket/Netlink.xs:195:20: warning: comparison of constant '20ul' with boolean
expression is always false [-Wbool-compare]
+ if(!SvCUR(msg) == sizeof(nlmsgerr))
+ ^~
+lib/Socket/Netlink.xs:195:20: warning: logical not is only applied to the left hand side
of comparison [-Wlogical-not-parentheses]
+
+This patch fixes it.
+
+CPAN RT#118688.
+
+Signed-off-by: Petr Písař <ppisar(a)redhat.com>
+---
+ lib/Socket/Netlink.xs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Socket/Netlink.xs b/lib/Socket/Netlink.xs
+index 6211b7f..6900819 100644
+--- a/lib/Socket/Netlink.xs
++++ b/lib/Socket/Netlink.xs
+@@ -192,7 +192,7 @@ unpack_nlmsgerr(msg)
+ PPCODE:
+ if(!SvPOK(msg))
+ croak("Expected a string message");
+- if(!SvCUR(msg) == sizeof(nlmsgerr))
++ if(SvCUR(msg) != sizeof(nlmsgerr))
+ croak("Expected %d bytes of message", sizeof(nlmsgerr));
+
+ Copy(SvPVbyte_nolen(msg), &nlmsgerr, sizeof(nlmsgerr), char);
+--
+2.7.4
+
diff --git a/perl-Socket-Netlink.spec b/perl-Socket-Netlink.spec
index d9c9a21..4702a5c 100644
--- a/perl-Socket-Netlink.spec
+++ b/perl-Socket-Netlink.spec
@@ -1,11 +1,13 @@
Name: perl-Socket-Netlink
Version: 0.04
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Interface to Linux's PF_NETLINK socket family
License: GPL+ or Artistic
URL:
http://search.cpan.org/dist/Socket-Netlink/
Source0:
http://www.cpan.org/authors/id/P/PE/PEVANS/Socket-Netlink-%{version}.tar.gz
+# Fix nlmsgerr length check, CPAN RT#118688
+Patch0: Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch
# Unit tests fail on ppc64:
#
https://rt.cpan.org/Public/Bug/Display.html?id=71112
@@ -47,6 +49,7 @@ IO::Socket::Netlink.
%prep
%setup -q -n Socket-Netlink-%{version}
+%patch0 -p1
%build
@@ -73,6 +76,9 @@ IO::Socket::Netlink.
%changelog
+* Wed Nov 09 2016 Petr Pisar <ppisar(a)redhat.com> - 0.04-3
+- Fix nlmsgerr length check (CPAN RT#118688)
+
* Tue Feb 02 2016 Emmanuel Seyman <emmanuel(a)seyman.fr> - 0.04-2
- Modernize spec
- Use %%license macro
--
cgit v0.12
http://pkgs.fedoraproject.org/cgit/perl-Socket-Netlink.git/commit/?h=el6&...