netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Synacek <jsynacek@redhat.com>
To: yoshfuji@linux-ipv6.org
Cc: netdev@vger.kernel.org, Jan Synacek <jsynacek@redhat.com>
Subject: [PATCH 2/2] ping6: Fix -F switch.
Date: Fri,  7 Dec 2012 09:25:24 +0100	[thread overview]
Message-ID: <1354868724-15549-3-git-send-email-jsynacek@redhat.com> (raw)
In-Reply-To: <1354868724-15549-1-git-send-email-jsynacek@redhat.com>

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

  parent reply	other threads:[~2012-12-07  8:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  8:25 [PATCH 0/2] iputils: minor ninfod and ping6 fixes Jan Synacek
2012-12-07  8:25 ` [PATCH 1/2] ninfod: Fix more unused variables Jan Synacek
2012-12-07  8:25 ` Jan Synacek [this message]
2012-12-10  9:58   ` [PATCH 2/2] ping6: Fix -F switch Jan Synacek
2012-12-10 10:12     ` [PATCH 2/2 fixed] " Jan Synacek
2012-12-19 21:05 ` [PATCH 0/2] iputils: minor ninfod and ping6 fixes YOSHIFUJI Hideaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1354868724-15549-3-git-send-email-jsynacek@redhat.com \
    --to=jsynacek@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).