From: Jo-Philipp Wich Date: Tue, 19 Feb 2013 22:53:21 +0000 (+0100) Subject: print a notification if forwards are skipped due to zone family mismatch X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0004ef54410c9993eced6f518923af2d9da6c482;p=oweals%2Ffirewall3.git print a notification if forwards are skipped due to zone family mismatch --- diff --git a/forwards.c b/forwards.c index e653356..1715abc 100644 --- a/forwards.c +++ b/forwards.c @@ -117,9 +117,7 @@ print_forward(enum fw3_table table, enum fw3_family family, if (table != FW3_TABLE_FILTER) return; - if (!fw3_is_family(forward, family) || - (forward->_src && !fw3_is_family(forward->_src, family)) || - (forward->_dest && !fw3_is_family(forward->_dest, family))) + if (!fw3_is_family(forward, family)) return; s = forward->_src ? forward->_src->name : "*"; @@ -130,6 +128,13 @@ print_forward(enum fw3_table table, enum fw3_family family, else info(" * Forward %s->%s", s, d); + if (!fw3_is_family(forward->_src, family) || + !fw3_is_family(forward->_dest, family)) + { + info(" ! Skipping due to different family of zone"); + return; + } + print_chain(forward); fw3_format_comment("forwarding ", s, "->", d); print_target(forward); diff --git a/zones.c b/zones.c index 62d9e36..edd875a 100644 --- a/zones.c +++ b/zones.c @@ -53,6 +53,7 @@ static const struct chain dst_chains[] = { static struct fw3_option zone_opts[] = { FW3_OPT("name", string, zone, name), + FW3_OPT("family", family, zone, family), FW3_LIST("network", device, zone, networks), FW3_LIST("device", device, zone, devices),