[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221013084344.0fe8f3de@hermes.local>
Date: Thu, 13 Oct 2022 08:43:44 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Francois Romieu <romieu@...zoreil.com>
Cc: Christian Pössinger <christian@...ssinger.com>,
netdev@...r.kernel.org
Subject: Re: iproute2/tc invalid JSON in 6.0.0 for flowid
On Thu, 13 Oct 2022 17:18:13 +0200
Francois Romieu <romieu@...zoreil.com> wrote:
> 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);
> }
>
Already sent patch.
Powered by blists - more mailing lists