[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230414094403.4d7db9df@hermes.local>
Date: Fri, 14 Apr 2023 09:44:03 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Lars Ekman <uablrek@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: iproute2 bug in json output for encap
On Fri, 14 Apr 2023 18:26:03 +0200
Lars Ekman <uablrek@...il.com> wrote:
> Hi again,
>
> Digging a little deeper I see that the double "dst" items will cause
> problems with most (all?) json parsers. I intend to use "go" and json
> parsing will be parsed to a "map" (hash-table) so duplicate keys will
> not work.
>
> https://stackoverflow.com/questions/21832701/does-json-syntax-allow-duplicate-keys-in-an-object
>
> IMHO it would be better to use a structured "encap" item. Something like;
>
> [ {
> "dst": "192.168.11.0/24",
> "encap": {
> "protocol": "ip6",
> "id": 0,
> "src": "::",
> "dst": "fd00::c0a8:2dd",
> "hoplimit": 0,
> "tc": 0
> },
> "scope": "link",
> "flags": [ ]
> } ]
>
> Best Regards,
>
> Lars Ekman
That makes sense, not sure if it would break any existing scripts.
Probably true for ip link as well.
Powered by blists - more mailing lists