mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 23:53:30 +01:00
Yet more ipset bugs
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2092 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
83adebbcfe
commit
2c32d4539a
@ -632,7 +632,7 @@ dest_ip_range() # $1 = Address or Address Range
|
|||||||
echo "-m set ! $(get_set_flags ${1#!} dst)"
|
echo "-m set ! $(get_set_flags ${1#!} dst)"
|
||||||
;;
|
;;
|
||||||
+*)
|
+*)
|
||||||
echo "-m set $(get_set_flags ${1#+} dst)"
|
echo "-m set $(get_set_flags $1 dst)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "-d $1"
|
echo "-d $1"
|
||||||
@ -642,45 +642,45 @@ dest_ip_range() # $1 = Address or Address Range
|
|||||||
|
|
||||||
both_ip_ranges() # $1 = Source address or range, $2 = dest address or range
|
both_ip_ranges() # $1 = Source address or range, $2 = dest address or range
|
||||||
{
|
{
|
||||||
local prefix= match=
|
local rangeprefix= setprefix= rangematch= setmatch=
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
*.*.*.*-*.*.*.*)
|
*.*.*.*-*.*.*.*)
|
||||||
prefix="-m iprange"
|
rangeprefix="-m iprange"
|
||||||
match="--src-range $1"
|
rangematch="--src-range $1"
|
||||||
|
;;
|
||||||
|
!+*)
|
||||||
|
setprefix="-m set"
|
||||||
|
setmatch="! $(get_set_flags ${1#!} src)"
|
||||||
;;
|
;;
|
||||||
+*)
|
+*)
|
||||||
prefix="-m set"
|
setprefix="-m set"
|
||||||
match="--set ${1#+} src"
|
setmatch="$(get_set_flags $1 src)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
match="-s $1"
|
rangematch="-s $1"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $2 in
|
case $2 in
|
||||||
*.*.*.*-*.*.*.*)
|
*.*.*.*-*.*.*.*)
|
||||||
prefix="-m iprange"
|
rangeprefix="-m iprange"
|
||||||
match="$match --dst-range $2"
|
rangematch="$rangematch --dst-range $2"
|
||||||
|
;;
|
||||||
|
!+*)
|
||||||
|
setprefix="-m set"
|
||||||
|
match="$setmatch ! $(get_set_flags ${2#!} dst)"
|
||||||
;;
|
;;
|
||||||
+*)
|
+*)
|
||||||
case $1 in
|
setprefix="-m set"
|
||||||
*.*.*.*-*.*.*.*)
|
setmatch="$setmatch $(get_set_flags $2 dst)"
|
||||||
prefix="$iprange -m set"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
prefix="-m set"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
match="--set ${1#+} dst"
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
match="$match -d $2"
|
rangematch="$rangematch -d $2"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$prefix $match"
|
echo "$rangeprefix $rangematch $setprefix $setmatch"
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user