X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=zones.c;h=3d3812ccdf7845aee795233f7c58616024cd2691;hp=979d150e56080719c67da43ef2029fc158c86c80;hb=d7988a8aaedbf22cf1d34268615034e3082613ce;hpb=f12271d15da3796c558b6649e97dad988ae2c057;ds=sidebyside diff --git a/zones.c b/zones.c index 979d150..3d3812c 100644 --- a/zones.c +++ b/zones.c @@ -574,7 +574,7 @@ fw3_flush_zones(struct fw3_ipt_handle *handle, struct fw3_state *state, for (c = zone_chains; c->format; c++) { /* don't touch user chains on selective stop */ - if (reload && hasbit(c->flag, FW3_FLAG_CUSTOM_CHAINS)) + if (reload && c->flag == FW3_FLAG_CUSTOM_CHAINS) continue; if (!fw3_is_family(c, handle->family)) @@ -583,6 +583,9 @@ fw3_flush_zones(struct fw3_ipt_handle *handle, struct fw3_state *state, if (c->table != handle->table) continue; + if (c->flag && !has(z->flags, handle->family, c->flag)) + continue; + snprintf(chain, sizeof(chain), c->format, z->name); fw3_ipt_delete_rules(handle, chain); fw3_ipt_delete_chain(handle, chain);