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

From: Lin Ma
Date: Thu Jan 04 2024 - 02:05:29 EST


Hello Jeremy,

>
> 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,

Oops, my bad. Just know that the nla_type will mask with `NLA_TYPE_MASK`.

Sorry for the bother. T^T

>
>
> Jeremy

Thanks
Lin