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>] [day] [month] [year] [list]
Date:   Mon,  5 Jun 2017 16:22:03 +0200
From:   Jiri Pirko <jiri@...nulli.us>
To:     netdev@...r.kernel.org
Cc:     stephen@...workplumber.org, mlxsw@...lanox.com
Subject: [patch iproute2/net-next] tc: gact: fix control action parsing

From: Jiri Pirko <jiri@...lanox.com>

parse_action_control helper does advancing of the arg inside. So don't
do it outside.

Fixes: e67aba559581 ("tc: actions: add helpers to parse and print control actions")
Signed-off-by: Jiri Pirko <jiri@...lanox.com>
---
 tc/m_gact.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/tc/m_gact.c b/tc/m_gact.c
index d95aa11..1a25833 100644
--- a/tc/m_gact.c
+++ b/tc/m_gact.c
@@ -90,17 +90,14 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
 
 	if (matches(*argv, "gact") == 0) {
 		ok++;
+		argc--;
+		argv++;
 	} else {
 		if (parse_action_control(&argc, &argv, &p.action, false) == -1)
 			usage();
 		ok++;
 	}
 
-	if (ok) {
-		argc--;
-		argv++;
-	}
-
 #ifdef CONFIG_GACT_PROB
 	if (ok && argc > 0) {
 		if (matches(*argv, "random") == 0) {
@@ -120,8 +117,6 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p,
 			if (parse_action_control(&argc, &argv,
 						 &pp.paction, false) == -1)
 				usage();
-			argc--;
-			argv++;
 			if (get_u16(&pp.pval, *argv, 10)) {
 				fprintf(stderr, "Illegal probability val 0x%x\n", pp.pval);
 				return -1;
-- 
2.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ