Explicit commits are not used by either arp- nor ebtables-save. In order
to share code between all the different *-save tools without inducing
changes to ruleset dump contents, allow for callers of do_output() to
turn COMMIT lines on or off.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
struct do_output_data {
bool counters;
+ bool commit;
};
static int
* thereby preventing dependency conflicts */
nft_chain_save(h, chain_list);
nft_rule_save(h, tablename, d->counters ? 0 : FMT_NOCOUNTS);
- printf("COMMIT\n");
+ if (d->commit)
+ printf("COMMIT\n");
now = time(NULL);
printf("# Completed on %s", ctime(&now));
init_extensions4();
#endif
tables = xtables_ipv4;
+ d.commit = true;
break;
case NFPROTO_ARP:
tables = xtables_arp;