mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-10 03:36:58 +02:00
Clean up QUEUE target code
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@763 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
c80dacd86a
commit
97825f937c
@ -2315,6 +2315,26 @@ add_a_rule()
|
|||||||
{
|
{
|
||||||
local natrule=
|
local natrule=
|
||||||
|
|
||||||
|
do_ports() {
|
||||||
|
if [ -n "$port" ]; then
|
||||||
|
dports="--dport"
|
||||||
|
if [ -n "$multioption" -a "$port" != "${port%,*}" ]; then
|
||||||
|
multiport="$multioption"
|
||||||
|
dports="--dports"
|
||||||
|
fi
|
||||||
|
dports="$dports $port"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$cport" ]; then
|
||||||
|
sports="--sport"
|
||||||
|
if [ -n "$multioption" -a "$cport" != "${cport%,*}" ]; then
|
||||||
|
multiport="$multioption"
|
||||||
|
sports="--sports"
|
||||||
|
fi
|
||||||
|
sports="$sports $cport"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Set source variables. The 'cli' variable will hold the client match predicate(s).
|
# Set source variables. The 'cli' variable will hold the client match predicate(s).
|
||||||
|
|
||||||
cli=
|
cli=
|
||||||
@ -2370,44 +2390,11 @@ add_a_rule()
|
|||||||
|
|
||||||
case $proto in
|
case $proto in
|
||||||
tcp|TCP|6)
|
tcp|TCP|6)
|
||||||
if [ -n "$port" ]; then
|
do_ports
|
||||||
dports="--dport"
|
|
||||||
if [ -n "$multioption" -a "$port" != "${port%,*}" ]; then
|
|
||||||
multiport="$multioption"
|
|
||||||
dports="--dports"
|
|
||||||
fi
|
|
||||||
dports="$dports $port"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$cport" ]; then
|
|
||||||
sports="--sport"
|
|
||||||
if [ -n "$multioption" -a "$cport" != "${cport%,*}" ]; then
|
|
||||||
multiport="$multioption"
|
|
||||||
sports="--sports"
|
|
||||||
fi
|
|
||||||
sports="$sports $cport"
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ "$target" = QUEUE ] && proto="$proto --syn"
|
[ "$target" = QUEUE ] && proto="$proto --syn"
|
||||||
;;
|
;;
|
||||||
udp|UDP|17)
|
udp|UDP|17)
|
||||||
if [ -n "$port" ]; then
|
do_ports
|
||||||
dports="--dport"
|
|
||||||
if [ -n "$multioption" -a "$port" != "${port%,*}" ]; then
|
|
||||||
multiport="$multioption"
|
|
||||||
dports="--dports"
|
|
||||||
fi
|
|
||||||
dports="$dports $port"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$cport" ]; then
|
|
||||||
sports="--sport"
|
|
||||||
if [ -n "$multioption" -a "$cport" != "${cport%,*}" ]; then
|
|
||||||
multiport="$multioption"
|
|
||||||
sports="--sports"
|
|
||||||
fi
|
|
||||||
sports="$sports $cport"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
icmp|ICMP|1)
|
icmp|ICMP|1)
|
||||||
[ -n "$port" ] && dports="--icmp-type $port"
|
[ -n "$port" ] && dports="--icmp-type $port"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user