Subject: Re: [PATCH v2 3/3] tools: ynl: ignore index 0 for indexed-arrays

From: Jakub Kicinski <[email-masked]>
Date: Mon, 10 Nov 2025 17:20:16 -0800

On Thu,  6 Nov 2025 16:15:29 +0100 Zahari Doychev wrote:
> Linux tc actions expect the action order to start from index one.
> To accommodate this, update the code generation so array indexing
> begins at 1 for tc actions.
> 
> This results in the following change:
> 
>         array = ynl_attr_nest_start(nlh, TCA_FLOWER_ACT);
>         for (i = 0; i < obj->_count.act; i++)
> -               tc_act_attrs_put(nlh, i, &obj->act[i]);
> +               tc_act_attrs_put(nlh, i + 1, &obj->act[i]);
>         ynl_attr_nest_end(nlh, array);
> 
> This change does not impact other indexed array attributes at
> the moment, as analyzed in [1].

YNL does not aim to provide perfect interfaces with weird old families.