mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 20:24:09 +01:00
Fix destination range handling
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5608 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
319bea7308
commit
a6f3ed93be
@ -808,12 +808,14 @@ sub do_user( $ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Create a "-m tos" match for the passed TOS[/MASK]
|
# Create a "-m tos" match for the passed TOS
|
||||||
#
|
#
|
||||||
sub do_tos( $ ) {
|
sub do_tos( $ ) {
|
||||||
my $tos = $_[0];
|
my $tos = $_[0];
|
||||||
|
|
||||||
$tos && $tos ne '-' ? "-m tos --tos $tos " : '';
|
$tos = '-' unless $tos;
|
||||||
|
|
||||||
|
$tos ne '-' ? "-m tos --tos $tos " : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -821,6 +823,7 @@ sub do_tos( $ ) {
|
|||||||
#
|
#
|
||||||
sub iprange_match() {
|
sub iprange_match() {
|
||||||
my $match = '';
|
my $match = '';
|
||||||
|
|
||||||
unless ( $iprangematch ) {
|
unless ( $iprangematch ) {
|
||||||
$match = '-m iprange ';
|
$match = '-m iprange ';
|
||||||
$iprangematch = 1;
|
$iprangematch = 1;
|
||||||
@ -859,7 +862,7 @@ sub match_dest_net( $ ) {
|
|||||||
if ( $net =~ /^(!?).*\..*\..*\..*-.*\..*\..*\..*/ ) {
|
if ( $net =~ /^(!?).*\..*\..*\..*-.*\..*\..*\..*/ ) {
|
||||||
$net =~ s/!// if my $invert = $1 ? '! ' : '';
|
$net =~ s/!// if my $invert = $1 ? '! ' : '';
|
||||||
|
|
||||||
iprange_match . "${invert}--src-range $net ";
|
iprange_match . "${invert}--dst-range $net ";
|
||||||
} elsif ( $net =~ /^!/ ) {
|
} elsif ( $net =~ /^!/ ) {
|
||||||
$net =~ s/!//;
|
$net =~ s/!//;
|
||||||
"-d ! $net ";
|
"-d ! $net ";
|
||||||
|
Loading…
Reference in New Issue
Block a user