Subject: Re: [patch net-next] tools: ynl: introduce option to ignore unknown attributes or types

From: Jakub Kicinski <[email-masked]>
Date: Thu, 12 Oct 2023 07:32:23 -0700

On Thu, 12 Oct 2023 16:04:38 +0200 Jiri Pirko wrote:
> $ sudo ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/devlink.yaml --do trap-get --json '{"bus-name": "netdevsim", "dev-name": "netdevsim1", "trap-name": "source_mac_is_multicast"}' --ignore-unknown
> {'bus-name': 'netdevsim',
>  'dev-name': 'netdevsim1',
>  'trap-action': 'drop',
>  'trap-group-name': 'l2_drops',
>  'trap-name': 'source_mac_is_multicast'}

Wouldn't it be better to put the unknown attr in as raw binary?
We can key it by attribute type (integer) and put the NlAttr object
in as the value.

That way at least the user still sees that the unknown attrs are
present.