summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--iptables/nft.c1
-rw-r--r--iptables/nft.h1
-rw-r--r--iptables/xtables-restore.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/iptables/nft.c b/iptables/nft.c
index 36ac69cc..501c6d86 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -744,6 +744,7 @@ __nft_chain_set(struct nft_handle *h, const char *table,
}
nlh = nft_chain_nlmsg_build_hdr(buf, NFT_MSG_NEWCHAIN, h->family,
+ h->restore ? NLM_F_ACK|NLM_F_CREATE :
NLM_F_ACK, h->seq);
nft_chain_nlmsg_build_payload(nlh, c);
diff --git a/iptables/nft.h b/iptables/nft.h
index 92488764..3b58d514 100644
--- a/iptables/nft.h
+++ b/iptables/nft.h
@@ -34,6 +34,7 @@ struct nft_handle {
struct mnl_nlmsg_batch *batch;
struct nft_family_ops *ops;
struct builtin_table *tables;
+ bool restore;
};
extern struct builtin_table xtables_ipv4[TABLES_MAX];
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index 730800ff..f7850bb2 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -170,6 +170,7 @@ xtables_restore_main(int family, const char *progname, int argc, char *argv[])
{
struct nft_handle h = {
.family = family,
+ .restore = true,
};
char buffer[10240];
int c;