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:   Thu, 13 Oct 2022 17:18:13 +0200
From:   Francois Romieu <romieu@...zoreil.com>
To:     Christian Pössinger <christian@...ssinger.com>
Cc:     netdev@...r.kernel.org,
        Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: iproute2/tc invalid JSON in 6.0.0 for flowid

Christian Pössinger <christian@...ssinger.com> :
[...]
> If you can point me to the location which could be responsible for this issue, I am happy to submit a fix to the net tree.

If the completely untested patch below does not work, you may also
dig the bits in include/json_print.h and lib/json_print.c 

(Ccing Stephen as the unidentified "both" in README.devel)

diff --git a/tc/f_u32.c b/tc/f_u32.c
index d787eb91..70098bcd 100644
--- a/tc/f_u32.c
+++ b/tc/f_u32.c
@@ -1275,11 +1275,11 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt,
 		fprintf(stderr, "divisor and hash missing ");
 	}
 	if (tb[TCA_U32_CLASSID]) {
+		char *fmt = !sel || !(sel->flags & TC_U32_TERMINAL) ? "*flowid %s" : "flowid %s";
 		SPRINT_BUF(b1);
-		fprintf(f, "%sflowid %s ",
-			!sel || !(sel->flags & TC_U32_TERMINAL) ? "*" : "",
-			sprint_tc_classid(rta_getattr_u32(tb[TCA_U32_CLASSID]),
-					  b1));
+
+		print_string(PRINT_ANY, "flowid", fmt,
+			    sprint_tc_classid(rta_getattr_u32(tb[TCA_U32_CLASSID]), b1));
 	} else if (sel && sel->flags & TC_U32_TERMINAL) {
 		print_string(PRINT_FP, NULL, "terminal flowid ", NULL);
 	}

-- 
Ueimor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ