Re: [PATCH net-next v1] net: mctp: use deprecated parser in mctp_set_link_af

From: Jeremy Kerr
Date: Thu Jan 04 2024 - 01:50:43 EST


Hi Lin,

> (1) will get AF_MCTP with nla_type(...) call, and (2) will then
> passing `af` to `mctp_set_link_af`, which will expect the
> `NLA_F_NESTED` flag.

You could set that flag? It's not exclusive with the attribute type.
>From netlink.h:

/*
* nla_type (16 bits)
* +---+---+-------------------------------+
* | N | O | Attribute Type |
* +---+---+-------------------------------+
* N := Carries nested attributes
* O := Payload stored in network byte order
*
* Note: The N and O flag are mutually exclusive.
*/

Which is what we do with existing userspace:

https://github.com/CodeConstruct/mctp/blob/6aa4b052d/src/mctp.c#L569C1-L569C1

Cheers,


Jeremy