add support for per-zone user chains
[project/firewall3.git] / redirects.c
index 2aa6664..2acfabc 100644 (file)
@@ -20,6 +20,8 @@
 
 
 const struct fw3_option fw3_redirect_opts[] = {
+       FW3_OPT("enabled",             bool,      redirect,     enabled),
+
        FW3_OPT("name",                string,    redirect,     name),
        FW3_OPT("family",              family,    redirect,     family),
 
@@ -131,10 +133,17 @@ fw3_load_redirects(struct fw3_state *state, struct uci_package *p)
                INIT_LIST_HEAD(&redir->proto);
                INIT_LIST_HEAD(&redir->mac_src);
 
+               redir->enabled = true;
                redir->reflection = true;
 
                fw3_parse_options(redir, fw3_redirect_opts, s);
 
+               if (!redir->enabled)
+               {
+                       fw3_free_redirect(redir);
+                       continue;
+               }
+
                if (redir->src.invert)
                {
                        warn_elem(e, "must not have an inverted source");