lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri,  7 Dec 2012 09:25:24 +0100
From:	Jan Synacek <jsynacek@...hat.com>
To:	yoshfuji@...ux-ipv6.org
Cc:	netdev@...r.kernel.org, Jan Synacek <jsynacek@...hat.com>
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@...hat.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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ