[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPpH65ziPuhSHwXdvfsMHf=Fddp8hj_nvum48w_01hD_+UBfAg@mail.gmail.com>
Date: Thu, 31 Oct 2019 17:28:43 +0100
From: Andrea Claudi <aclaudi@...hat.com>
To: David Ahern <dsahern@...il.com>
Cc: linux-netdev <netdev@...r.kernel.org>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH iproute2] ip-route: fix json formatting for multipath routing
On Thu, Oct 31, 2019 at 5:11 PM David Ahern <dsahern@...il.com> wrote:
>
> On 10/31/19 9:09 AM, Andrea Claudi wrote:
> > json output for multipath routing is broken due to some non-jsonified
> > print in print_rta_multipath(). To reproduce the issue:
> >
> > $ ip route add default \
> > nexthop via 192.168.1.1 weight 1 \
> > nexthop via 192.168.2.1 weight 1
> > $ ip -j route | jq
> > parse error: Invalid numeric literal at line 1, column 58
> >
> > Fix this opening a "multipath" json array that can contain multiple
> > route objects, and using print_*() instead of fprintf().
> >
> > This is the output for the above commands applying this patch:
> >
> > [
> > {
> > "dst": "default",
> > "flags": [],
> > "multipath": [
> > {
> > "gateway": "192.168.1.1",
> > "dev": "wlp61s0",
> > "weight": 1,
> > "flags": [
> > "linkdown"
> > ]
> > },
> > {
> > "gateway": "192.168.2.1",
> > "dev": "ens1u1",
> > "weight": 1,
> > "flags": []
> > }
> > ]
> > }
> > ]
> >
> > Fixes: f48e14880a0e5 ("iproute: refactor multipath print")
> > Signed-off-by: Andrea Claudi <aclaudi@...hat.com>
> > Reported-by: Patrick Hagara <phagara@...hat.com>
> > ---
> > ip/iproute.c | 23 +++++++++++++++++------
> > 1 file changed, 17 insertions(+), 6 deletions(-)
> >
>
> This is fixed -next by 4ecefff3cf25 ("ip: fix ip route show json output
> for multipath nexthops"). Stephen can cherry pick it for master
Oops, I overlooked that. Thanks David for pointing this out, please
ignore this and sorry for the noise.
Powered by blists - more mailing lists