Add more license tags with SPDX identifiers
[openwrt-github/.git] / package / network / config / firewall / files / firewall.init
index 8abbf68254933b47f03e8eb6f881f9353c5dd659..ee3ed1a28356759e71930ebc2bb0158451e0a7d3 100755 (executable)
@@ -7,29 +7,25 @@ QUIET=""
 validate_firewall_redirect()
 {
        uci_validate_section firewall redirect "${1}" \
-               'proto:or("tcp", "udp", "tcpudp")' \
+               'proto:or(uinteger, string)' \
                'src:string' \
-               'src_ip:ipaddr' \
-               'src_dport:string' \
+               'src_ip:cidr' \
+               'src_dport:or(port, portrange)' \
                'dest:string' \
-               'dest_ip:ipaddr' \
-               'dest_port:string' \
+               'dest_ip:cidr' \
+               'dest_port:or(port, portrange)' \
                'target:or("SNAT", "DNAT")'
-       
-       return $?
 }
 
 validate_firewall_rule()
 {
        uci_validate_section firewall rule "${1}" \
-               'proto:string' \
+               'proto:or(uinteger, string)' \
                'src:string' \
                'dest:string' \
-               'src_port:string' \
-               'dest_port:string' \
+               'src_port:or(port, portrange)' \
+               'dest_port:or(port, portrange)' \
                'target:string'
-       
-       return $?
 }
 
 service_triggers() {
@@ -60,6 +56,6 @@ reload_service() {
 boot() {
        # Be silent on boot, firewall might be started by hotplug already,
        # so don't complain in syslog.
-       QUIET=1
+       QUIET=-q
        start
 }