diff options
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -1318,8 +1318,9 @@ static void nft_cmd_expand_chain(struct chain *chain, struct list_head *new_cmds list_for_each_entry_safe(rule, next, &chain->rules, list) { list_del(&rule->list); + handle_merge(&rule->handle, &chain->handle); memset(&h, 0, sizeof(h)); - handle_merge(&h, &rule->handle); + handle_merge(&h, &chain->handle); if (chain->flags & CHAIN_F_BINDING) { rule->handle.chain_id = chain->handle.chain_id; rule->handle.chain.location = chain->location; @@ -1350,6 +1351,7 @@ void nft_cmd_expand(struct cmd *cmd) return; list_for_each_entry(chain, &table->chains, list) { + handle_merge(&chain->handle, &table->handle); memset(&h, 0, sizeof(h)); handle_merge(&h, &chain->handle); h.chain_id = chain->handle.chain_id; @@ -1394,6 +1396,21 @@ void nft_cmd_expand(struct cmd *cmd) nft_cmd_expand_chain(chain, &new_cmds); list_splice(&new_cmds, &cmd->list); break; + default: + break; + } +} + +void nft_cmd_post_expand(struct cmd *cmd) +{ + struct list_head new_cmds; + struct set *set; + struct cmd *new; + struct handle h; + + init_list_head(&new_cmds); + + switch (cmd->obj) { case CMD_OBJ_SET: case CMD_OBJ_MAP: set = cmd->set; |