Subject: Re: [PATCH net-next v2 06/10] tools/net/ynl: Add support for netlink-raw families

From: Donald Hunter <[email-masked]>
Date: Thu, 17 Aug 2023 10:10:35 +0100

Jakub Kicinski <[email-masked]> writes:

> On Tue, 15 Aug 2023 20:42:50 +0100 Donald Hunter wrote:
>> Refactor the ynl code to encapsulate protocol specifics into
>> NetlinkProtocol and GenlProtocol.
>
> Looks good, but do we also need some extra plumbing to decode extack
> for classic netlink correctly?  Basically shouldn't _decode_extack()
> also move to proto? Or we can parameterize it? All we really need there
> is to teach it how much of fixed headers parser needs to skip to get to
> attributes, really (which, BTW is already kinda buggy for genl families
> with fixed headers).

I have been working on the assumption that extack responses don't
include any fixed headers. I have seen extack messages decoded correctly
for classic netlink, here with RTM_NEWROUTE:

lib.ynl.NlError: Netlink error: Invalid argument
nl_len = 80 (64) nl_flags = 0x300 nl_type = 2
  error: -22  extack: {'msg': 'Invalid prefix for given prefix length'}

Is there something I am missing?