diff --git a/src/cli/cli.c b/src/cli/cli.c index c9209a22..abd06094 100644 --- a/src/cli/cli.c +++ b/src/cli/cli.c @@ -84,6 +84,17 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + // Set rules indexes + bf_list_foreach (&chains, chain_node) { + struct bf_chain *chain = bf_list_node_get_data(chain_node); + uint32_t index = 0; + + bf_list_foreach (&chain->rules, rule_node) { + struct bf_rule *rule = bf_list_node_get_data(rule_node); + rule->index = index++; + } + } + bf_list_foreach (&chains, chain_node) { struct bf_chain *chain = bf_list_node_get_data(chain_node); _cleanup_bf_request_ struct bf_request *request = NULL;