Skip rules with invalid options
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 18 Nov 2013 12:37:30 +0000 (12:37 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Mon, 18 Nov 2013 12:37:30 +0000 (12:37 +0000)
rules.c

diff --git a/rules.c b/rules.c
index bd2a57c19c5ed354b4ba9e4fd98321921d61a657..8ecefb03bfed279ca2c85a28fb492ff30d91c182 100644 (file)
--- a/rules.c
+++ b/rules.c
@@ -105,7 +105,12 @@ fw3_load_rules(struct fw3_state *state, struct uci_package *p)
 
                rule->enabled = true;
 
-               fw3_parse_options(rule, fw3_rule_opts, s);
+               if (!fw3_parse_options(rule, fw3_rule_opts, s))
+               {
+                       warn_elem(e, "skipped due to invalid options");
+                       fw3_free_rule(rule);
+                       continue;
+               }
 
                if (!rule->enabled)
                {