[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <34a51d38.e7c87.1898b8a81b6.Coremail.linma@zju.edu.cn>
Date: Tue, 25 Jul 2023 13:34:17 +0800 (GMT+08:00)
From: "Lin Ma" <linma@....edu.cn>
To: "Leon Romanovsky" <leon@...nel.org>
Cc: "Jakub Kicinski" <kuba@...nel.org>, jgg@...pe.ca,
markzhang@...dia.com, michaelgur@...dia.com, ohartoov@...dia.com,
chenzhongjin@...wei.com, yuancan@...wei.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] RDMA/nldev: Add length check for
IFLA_BOND_ARP_IP_TARGET parsing
Hi Leon,
>
> Right, and this is what bothers me.
>
> I would more than happy to change nla_for_each_nested() to be something
> like nla_for_each_nested_type(...., sizeof(u32)), which will skip empty
> lines, for code which can't have them.
>
> Thanks
>
Well, nla_for_each_nested_type(...., sizeof(u32)) seems good if the nested
attribute is sure to contain only one type of attribute with constant length.
(like the case of RDMA_NLDEV_ATTR_STAT_HWCOUNTERS).
I accept that it is another elegant solution here. But efforts are needed to
make sure if this is true for other cases.
Regards
Lin
Powered by blists - more mailing lists