forked from extern/shorewall_code
Some optimizations to the Dynamic Zone code
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@281 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e55951ba31
commit
93db8120f9
@ -3451,6 +3451,14 @@ refresh_firewall()
|
|||||||
rm -rf $TMP_DIR
|
rm -rf $TMP_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Query NetFilter about the existence of a filter chain #
|
||||||
|
################################################################################
|
||||||
|
chain_exists() # $1 = chain name
|
||||||
|
{
|
||||||
|
qt iptables -L $1 -n
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Add a host or subnet to a zone #
|
# Add a host or subnet to a zone #
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -3458,11 +3466,6 @@ add_to_zone() # $1 = <interface>[:<hosts>] $2 = zone
|
|||||||
{
|
{
|
||||||
local base
|
local base
|
||||||
|
|
||||||
chain_exists() # $1 = chain name
|
|
||||||
{
|
|
||||||
qt iptables -L $1 -n
|
|
||||||
}
|
|
||||||
|
|
||||||
nat_chain_exists() # $1 = chain name
|
nat_chain_exists() # $1 = chain name
|
||||||
{
|
{
|
||||||
qt iptables -t nat -L $1 -n
|
qt iptables -t nat -L $1 -n
|
||||||
@ -3620,11 +3623,6 @@ add_to_zone() # $1 = <interface>[:<hosts>] $2 = zone
|
|||||||
################################################################################
|
################################################################################
|
||||||
delete_from_zone() # $1 = <interface>[:<hosts>] $2 = zone
|
delete_from_zone() # $1 = <interface>[:<hosts>] $2 = zone
|
||||||
{
|
{
|
||||||
chain_exists() # $1 = chain name
|
|
||||||
{
|
|
||||||
qt iptables -L $1 -n
|
|
||||||
}
|
|
||||||
|
|
||||||
delete_from_zones_file()
|
delete_from_zones_file()
|
||||||
{
|
{
|
||||||
> ${STATEDIR}/zones_$$
|
> ${STATEDIR}/zones_$$
|
||||||
@ -3671,7 +3669,8 @@ delete_from_zone() # $1 = <interface>[:<hosts>] $2 = zone
|
|||||||
|
|
||||||
delhost="$interface:$host"
|
delhost="$interface:$host"
|
||||||
|
|
||||||
[ -z "`delete_from_zones_file`" ] && startup_error "Error: $1 not in zone $2"
|
[ -z "`delete_from_zones_file`" ] && \
|
||||||
|
error_message "Warning: $1 does not appear to be in zone $2"
|
||||||
|
|
||||||
while read z hosts; do
|
while read z hosts; do
|
||||||
eval ${z}_hosts=\"$hosts\"
|
eval ${z}_hosts=\"$hosts\"
|
||||||
|
Loading…
Reference in New Issue
Block a user