Increase compatibility to old firewall by initializing protocol of rules and redirect...
[project/firewall3.git] / rules.c
diff --git a/rules.c b/rules.c
index e6af62e..1037d2f 100644 (file)
--- a/rules.c
+++ b/rules.c
@@ -150,6 +150,12 @@ fw3_load_rules(struct fw3_state *state, struct uci_package *p)
                                     "- assuming an output rule");
                }
 
                                     "- assuming an output rule");
                }
 
+               if (list_empty(&rule->proto))
+               {
+                       warn_elem(e, "does not specify a protocol, assuming TCP+UDP");
+                       fw3_parse_protocol(&rule->proto, "tcpudp", true);
+               }
+
                if (rule->target == FW3_FLAG_UNSPEC)
                {
                        warn_elem(e, "has no target specified, defaulting to REJECT");
                if (rule->target == FW3_FLAG_UNSPEC)
                {
                        warn_elem(e, "has no target specified, defaulting to REJECT");