From: Jo-Philipp Wich Date: Wed, 20 Feb 2013 10:50:02 +0000 (+0100) Subject: only emit zone flush commands if the zone is active for the current family X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=commitdiff_plain;h=3968e2a659324a24bb1bd8d461c8bb83c5db7f72;hp=bb6873d86322a66bc01fc4195512ba5d2c78bddb only emit zone flush commands if the zone is active for the current family --- 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));