From: Jo-Philipp Wich Date: Sun, 10 Mar 2013 19:36:33 +0000 (+0100) Subject: Only run includes and set sysctls if either v4 or v6 firewall was actually started X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=24e1ba98e43d44ad7ba5780afd0b98e19ee14570;p=oweals%2Ffirewall3.git Only run includes and set sysctls if either v4 or v6 firewall was actually started --- diff --git a/main.c b/main.c index 09baca9..3654c15 100644 --- a/main.c +++ b/main.c @@ -255,8 +255,6 @@ start(struct fw3_state *state, bool reload) if (!print_rules && !reload) { - fw3_set_defaults(state); - if (fw3_command_pipe(false, "ipset", "-exist", "-")) { fw3_create_ipsets(state); @@ -311,11 +309,16 @@ start(struct fw3_state *state, bool reload) rv = 0; } - if (!reload && !print_rules) - fw3_run_includes(state); + if (!rv) + { + fw3_set_defaults(state); + + if (!reload && !print_rules) + fw3_run_includes(state); - if (!rv && !print_rules) - fw3_write_statefile(state); + if (!print_rules) + fw3_write_statefile(state); + } return rv; }