summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-save.c
diff options
context:
space:
mode:
Diffstat (limited to 'iptables/xtables-save.c')
-rw-r--r--iptables/xtables-save.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/iptables/xtables-save.c b/iptables/xtables-save.c
index 491122f3..0cf11f99 100644
--- a/iptables/xtables-save.c
+++ b/iptables/xtables-save.c
@@ -250,7 +250,6 @@ static int __ebt_save(struct nft_handle *h, const char *tablename, bool counters
{
struct nftnl_chain_list *chain_list;
unsigned int format = FMT_NOCOUNTS;
- static bool first = true;
time_t now;
if (!nft_table_find(h, tablename)) {
@@ -265,12 +264,9 @@ static int __ebt_save(struct nft_handle *h, const char *tablename, bool counters
chain_list = nft_chain_list_get(h, tablename);
- if (first) {
- now = time(NULL);
- printf("# Generated by %s v%s on %s", prog_name,
- prog_vers, ctime(&now));
- first = false;
- }
+ now = time(NULL);
+ printf("# Generated by %s v%s on %s", prog_name,
+ prog_vers, ctime(&now));
printf("*%s\n", tablename);
if (counters)
@@ -281,7 +277,8 @@ static int __ebt_save(struct nft_handle *h, const char *tablename, bool counters
* thereby preventing dependency conflicts */
nft_chain_save(h, chain_list);
nft_rule_save(h, tablename, format);
- printf("\n");
+ now = time(NULL);
+ printf("# Completed on %s", ctime(&now));
return 0;
}
@@ -361,6 +358,7 @@ int xtables_arp_save_main(int argc, char **argv)
struct nft_handle h = {
.family = NFPROTO_ARP,
};
+ time_t now;
int c;
xtables_globals.program_name = basename(*argv);;
@@ -407,10 +405,13 @@ int xtables_arp_save_main(int argc, char **argv)
return 0;
}
+ printf("# Generated by %s v%s on %s", prog_name,
+ prog_vers, ctime(&now));
printf("*filter\n");
nft_chain_save(&h, nft_chain_list_get(&h, "filter"));
nft_rule_save(&h, "filter", show_counters ? 0 : FMT_NOCOUNTS);
- printf("\n");
+ now = time(NULL);
+ printf("# Completed on %s", ctime(&now));
nft_fini(&h);
return 0;
}