From 0baa08fed43fa318eaa6ffe02673289343ac9cc0 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Tue, 23 Apr 2019 15:16:20 +0200 Subject: xtables: unify user chain add/flush for restore case The idea here is to move the 'flush' decision into the core, rather than have the decision in the frontend. This will be required later when "generation id" is passed to kernel. In this case, we might have to add the flush when re-trying the transaction. Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- iptables/xtables-translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'iptables/xtables-translate.c') diff --git a/iptables/xtables-translate.c b/iptables/xtables-translate.c index e1d2a7d6..eb35890a 100644 --- a/iptables/xtables-translate.c +++ b/iptables/xtables-translate.c @@ -329,8 +329,8 @@ static const struct option options[] = { { NULL }, }; -static int xlate_chain_user_add(struct nft_handle *h, const char *chain, - const char *table) +static int xlate_chain_user_restore(struct nft_handle *h, const char *chain, + const char *table) { printf("add chain %s %s %s\n", family2str[h->family], table, chain); return 0; @@ -416,7 +416,7 @@ static int dummy_compat_rev(const char *name, uint8_t rev, int opt) static struct nft_xt_restore_cb cb_xlate = { .table_new = xlate_table_new, .chain_set = xlate_chain_set, - .chain_user_add = xlate_chain_user_add, + .chain_restore = xlate_chain_user_restore, .do_command = do_command_xlate, .commit = commit, .abort = commit, -- cgit v1.2.3