From 3968e2a659324a24bb1bd8d461c8bb83c5db7f72 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 20 Feb 2013 11:50:02 +0100 Subject: [PATCH] only emit zone flush commands if the zone is active for the current family --- zones.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zones.c b/zones.c index edd875a..9595c37 100644 --- a/zones.c +++ b/zones.c @@ -224,6 +224,8 @@ print_zone_chain(enum fw3_table table, enum fw3_family family, if (!fw3_is_family(zone, family)) return; + setbit(zone->dst_flags, family); + if (!zone->conntrack && !disable_notrack) setbit(zone->dst_flags, FW3_TARGET_NOTRACK); @@ -464,6 +466,9 @@ fw3_flush_zones(enum fw3_table table, enum fw3_family family, if (e->type != FW3_TYPE_ZONE) continue; + if (!hasbit(e->flags[1], family)) + continue; + print_chains(table, family, pass2 ? "-X %s\n" : "-F %s\n", e->name, e->flags[0], src_chains, ARRAY_SIZE(src_chains)); -- 2.25.1