projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Separate running from current state flags in ipset handling, remove ipsets per family
[project/firewall3.git]
/
rules.c
diff --git
a/rules.c
b/rules.c
index
e733cd9
..
c3f03cf
100644
(file)
--- a/
rules.c
+++ b/
rules.c
@@
-20,6
+20,8
@@
const struct fw3_option fw3_rule_opts[] = {
const struct fw3_option fw3_rule_opts[] = {
+ FW3_OPT("enabled", bool, rule, enabled),
+
FW3_OPT("name", string, rule, name),
FW3_OPT("family", family, rule, family),
FW3_OPT("name", string, rule, name),
FW3_OPT("family", family, rule, family),
@@
-91,8
+93,16
@@
fw3_load_rules(struct fw3_state *state, struct uci_package *p)
INIT_LIST_HEAD(&rule->icmp_type);
INIT_LIST_HEAD(&rule->icmp_type);
+ rule->enabled = true;
+
fw3_parse_options(rule, fw3_rule_opts, s);
fw3_parse_options(rule, fw3_rule_opts, s);
+ if (!rule->enabled)
+ {
+ fw3_free_rule(rule);
+ continue;
+ }
+
if (rule->src.invert || rule->dest.invert)
{
warn_elem(e, "must not have inverted 'src' or 'dest' options");
if (rule->src.invert || rule->dest.invert)
{
warn_elem(e, "must not have inverted 'src' or 'dest' options");