netifd: fix validation constraints

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 39648
master
Jo-Philipp Wich 11 years ago
parent 21f4cf1a73
commit 354efde275
  1. 30
      package/network/config/netifd/files/etc/init.d/network

@ -57,12 +57,12 @@ validate_route_section()
{ {
uci_validate_section network route "${1}" \ uci_validate_section network route "${1}" \
'interface:string' \ 'interface:string' \
'target:ip4addr' \ 'target:cidr4' \
'netmask:ip4prefix' \ 'netmask:netmask4' \
'gateway:ip4addr' \ 'gateway:ip4addr' \
'metric:uinteger' \ 'metric:uinteger' \
'mtu:uinteger' \ 'mtu:uinteger' \
'table:range(0,65535)' 'table:or(range(0,65535),string)'
return $? return $?
} }
@ -71,11 +71,11 @@ validate_route6_section()
{ {
uci_validate_section network route6 "${1}" \ uci_validate_section network route6 "${1}" \
'interface:string' \ 'interface:string' \
'target:ip6addr' \ 'target:cidr6' \
'gateway:ip6addr' \ 'gateway:ip6addr' \
'metric:uinteger' \ 'metric:uinteger' \
'mtu:uinteger' \ 'mtu:uinteger' \
'table:range(0,65535)' 'table:or(range(0,65535),string)'
return $? return $?
} }
@ -85,12 +85,12 @@ validate_rule_section()
uci_validate_section network rule "${1}" \ uci_validate_section network rule "${1}" \
'in:string' \ 'in:string' \
'out:string' \ 'out:string' \
'src:ip4prefix' \ 'src:cidr4' \
'dest:ip4prefix' \ 'dest:cidr4' \
'tos:rage(0.31)' \ 'tos:range(0,31)' \
'string:mark' \ 'mark:string' \
'invert:bool' \ 'invert:bool' \
'lookup:range(0,65535)' \ 'lookup:or(range(0,65535),string)' \
'goto:range(0,65535)' \ 'goto:range(0,65535)' \
'action:or("prohibit", "unreachable", "blackhole", "throw")' 'action:or("prohibit", "unreachable", "blackhole", "throw")'
@ -102,12 +102,12 @@ validate_rule6_section()
uci_validate_section network rule6 "${1}" \ uci_validate_section network rule6 "${1}" \
'in:string' \ 'in:string' \
'out:string' \ 'out:string' \
'src:ip4prefix' \ 'src:cidr6' \
'dest:ip4prefix' \ 'dest:cidr6' \
'tos:rage(0.31)' \ 'tos:range(0,31)' \
'string:mark' \ 'mark:string' \
'invert:bool' \ 'invert:bool' \
'lookup:range(0,65535)' \ 'lookup:or(range(0,65535),string)' \
'goto:range(0,65535)' \ 'goto:range(0,65535)' \
'action:or("prohibit", "unreachable", "blackhole", "throw")' 'action:or("prohibit", "unreachable", "blackhole", "throw")'

Loading…
Cancel
Save