fw3_hotplug_zones(run_state, false);
for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
fw3_hotplug_zones(run_state, false);
for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
- {
- if (fw3_command_pipe(false, "ipset", "-exist", "-"))
- {
- fw3_destroy_ipsets(run_state);
- fw3_command_close();
- }
- }
+ fw3_destroy_ipsets(run_state);
- if (!print_rules)
- {
- if (fw3_command_pipe(false, "ipset", "-exist", "-"))
- {
- fw3_create_ipsets(cfg_state);
- fw3_command_close();
- }
- }
+ if (!print_family)
+ fw3_create_ipsets(cfg_state);
for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
{
if (family == FW3_FAMILY_V6 && cfg_state->defaults.disable_ipv6)
continue;
for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
{
if (family == FW3_FAMILY_V6 && cfg_state->defaults.disable_ipv6)
continue;
{
warn("The %s firewall appears to be started already. "
"If it is indeed empty, remove the %s file and retry.",
{
warn("The %s firewall appears to be started already. "
"If it is indeed empty, remove the %s file and retry.",
fw3_print_zone_rules(handle, cfg_state, false);
fw3_print_default_tail_rules(handle, cfg_state, false);
fw3_print_zone_rules(handle, cfg_state, false);
fw3_print_default_tail_rules(handle, cfg_state, false);
family_set(run_state, family, true);
family_set(cfg_state, family, true);
family_set(run_state, family, true);
family_set(cfg_state, family, true);
{
fw3_run_includes(cfg_state, false);
fw3_hotplug_zones(cfg_state, true);
{
fw3_run_includes(cfg_state, false);
fw3_hotplug_zones(cfg_state, true);
info(" * Clearing %s %s table",
fw3_flag_names[family], fw3_flag_names[table]);
info(" * Clearing %s %s table",
fw3_flag_names[family], fw3_flag_names[table]);
- if (run_state)
- {
- fw3_flush_rules(handle, run_state, true);
- fw3_flush_zones(handle, run_state, true);
- }
-
+ fw3_flush_rules(handle, run_state, true);
+ fw3_flush_zones(handle, run_state, true);
family_set(run_state, family, true);
family_set(cfg_state, family, true);
family_set(run_state, family, true);
family_set(cfg_state, family, true);
-
- if (!print_rules)
- {
- fw3_run_includes(cfg_state, true);
- fw3_hotplug_zones(cfg_state, true);
- fw3_write_statefile(cfg_state);
- }
+ fw3_run_includes(cfg_state, true);
+ fw3_hotplug_zones(cfg_state, true);
+ fw3_write_statefile(cfg_state);
- if (use_family == FW3_FAMILY_ANY)
- use_family = FW3_FAMILY_V4;
- else if (use_family == FW3_FAMILY_V6 && defs->disable_ipv6)
+ if (family == FW3_FAMILY_ANY)
+ family = FW3_FAMILY_V4;
+ else if (family == FW3_FAMILY_V6 && defs->disable_ipv6)
warn("IPv6 rules globally disabled in configuration");
freopen("/dev/null", "w", stderr);
cfg_state->disable_ipsets = true;
warn("IPv6 rules globally disabled in configuration");
freopen("/dev/null", "w", stderr);
cfg_state->disable_ipsets = true;