On 19/03/2026 21:18, Jakub Kicinski wrote:
> On Thu, 19 Mar 2026 20:56:46 +0100 Maxime Chevallier wrote:
>>> for_each_netdev_dump(net, netdev, state->ifindex) {
>>> + /* Either the provided ifindex doesn't exist or done dumping */
>>> + if (ifindex_attr &&
>>> + netdev->ifindex != nla_get_u32(ifindex_attr))
>>> + break;
>>
>> If the passed ifindex doesn't exist, isn't netdev NULL here ?
>
> The for_each will give us the next netdev after or not enter the loop
> at all. (the selftest in patch 2 does cover this case FWIW)
Ah I missed the loop skipping step. I like that construct then, wish I'd
thought of that with the ethnl phy dumpit stuff, I may take inspiration
here as it avoids treating filtered and non-filtered dumps differently.
Sorry for the noise then,
Maxime