Fix -F switch (flowlabel patch)

This commit is contained in:
Jan Synacek 2012-12-07 11:10:40 +01:00
parent 1ff80602c0
commit 8ea6bb38d5
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,30 @@
From e934222cd8e31bbd26d01eb156df543ba4110e7d Mon Sep 17 00:00:00 2001
From: Jan Synacek <jsynacek@redhat.com>
Date: Fri, 7 Dec 2012 09:14:20 +0100
Subject: [PATCH 2/2] ping6: Fix -F switch.
Even when the flowlabel is set correctly, ping6 exits with a warning. For some
reason, the errno is set when it should not be.
Signed-off-by: Jan Synacek <jsynacek@redhat.com>
---
ping6.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ping6.c b/ping6.c
index 358a035..85d3782 100644
--- a/ping6.c
+++ b/ping6.c
@@ -725,7 +725,8 @@ int main(int argc, char *argv[])
switch(ch) {
case 'F':
flowlabel = hextoui(optarg);
- if (errno || (flowlabel & ~IPV6_FLOWINFO_FLOWLABEL)) {
+ if ((flowlabel < 0 && errno) ||
+ (flowlabel & ~IPV6_FLOWINFO_FLOWLABEL)) {
fprintf(stderr, "ping: Invalid flowinfo %s\n", optarg);
exit(2);
}
--
1.8.0.1

View File

@ -19,6 +19,8 @@ Patch0: iputils-20020927-rh.patch
Patch1: iputils-ifenslave.patch Patch1: iputils-ifenslave.patch
# upstreamed # upstreamed
Patch2: iputils-20121125-ninfod-minor.patch Patch2: iputils-20121125-ninfod-minor.patch
# pending upstream approval
Patch3: iputils-20121207-ping6-flowlabel.patch
BuildRequires: docbook-utils perl-SGMLSpm BuildRequires: docbook-utils perl-SGMLSpm
BuildRequires: glibc-kernheaders >= 2.4-8.19 BuildRequires: glibc-kernheaders >= 2.4-8.19
@ -69,6 +71,7 @@ Queries.
%patch0 -p1 -b .rh %patch0 -p1 -b .rh
%patch1 -p1 -b .addr %patch1 -p1 -b .addr
%patch2 -p1 -b .ninfod-minor %patch2 -p1 -b .ninfod-minor
%patch3 -p1 -b .flowlabel
%build %build
%ifarch s390 s390x %ifarch s390 s390x
@ -181,6 +184,7 @@ mv -f RELNOTES.tmp RELNOTES
by the previous update by the previous update
- Update ninfod-minor patch - Update ninfod-minor patch
- Renumber patches - Renumber patches
- Fix -F switch (flowlabel patch)
* Thu Dec 06 2012 Jan Synáček <jsynacek@redhat.com> - 20121205-1 * Thu Dec 06 2012 Jan Synáček <jsynacek@redhat.com> - 20121205-1
- Update to iputils-s20121205 (#884436) and remove unnecessary patches - Update to iputils-s20121205 (#884436) and remove unnecessary patches