mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
[package] firewall: allow symbolic names of interfaces and aliases in masq_src and masq_dest
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@27196 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
@@ -227,3 +227,20 @@ fw_get_negation() {
|
||||
export -n -- "$_var=! $_flag ${_ipaddr#!}" || \
|
||||
export -n -- "$_var=${_ipaddr:+$_flag $_ipaddr}"
|
||||
}
|
||||
|
||||
fw_get_subnet4() {
|
||||
local _var="$1"
|
||||
local _flag="$2"
|
||||
local _name="$3"
|
||||
|
||||
local _ipaddr="$(uci_get_state network "${_name#!}" ipaddr)"
|
||||
local _netmask="$(uci_get_state network "${_name#!}" netmask)"
|
||||
|
||||
case "$_ipaddr" in
|
||||
*.*.*.*)
|
||||
[ "${_name#!}" != "$_name" ] && \
|
||||
export -n -- "$_var=! $_flag $_ipaddr/${_netmask:-255.255.255.255}" || \
|
||||
export -n -- "$_var=$_flag $_ipaddr/${_netmask:-255.255.255.255}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user