mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-17 02:00:57 +01:00
Issue a warning when a rule will be optimized away due to 'destonly'.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
46a6a7b258
commit
a5412cff38
@ -2376,8 +2376,17 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$ ) {
|
|||||||
#
|
#
|
||||||
# If we are processing an inline action, we need the source zone for NAT.
|
# If we are processing an inline action, we need the source zone for NAT.
|
||||||
#
|
#
|
||||||
$sourceref = find_zone( $chainref->{sourcezone} ) if $chainref->{sourcezone};
|
if ( $chainref->{sourcezone} ) {
|
||||||
|
$sourceref = find_zone( $chainref->{sourcezone} );
|
||||||
|
unless ( $wildcard ) {
|
||||||
|
warning_message "The SOURCE in this rule is 'destonly'" if $sourceref->{destonly} && ! $sourceref->{complex};
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
unless ( $wildcard ) {
|
||||||
|
warning_message "The SOURCE zone in this rule is 'destonly'" if $sourceref->{destonly} && ! $sourceref->{complex};
|
||||||
|
}
|
||||||
|
|
||||||
unless ( $actiontype & NATONLY ) {
|
unless ( $actiontype & NATONLY ) {
|
||||||
#
|
#
|
||||||
# Check for illegal bridge port rule
|
# Check for illegal bridge port rule
|
||||||
|
@ -747,8 +747,11 @@ sub add_group_to_zone($$$$$)
|
|||||||
my $zoneref = $zones{$zone};
|
my $zoneref = $zones{$zone};
|
||||||
my $zonetype = $zoneref->{type};
|
my $zonetype = $zoneref->{type};
|
||||||
|
|
||||||
|
$interfaceref = $interfaces{$interface};
|
||||||
$zoneref->{interfaces}{$interface} = 1;
|
$zoneref->{interfaces}{$interface} = 1;
|
||||||
|
$zoneref->{destonly} ||= $interfaceref->{options}{destonly};
|
||||||
|
|
||||||
|
$interfaceref->{zones}{$zone} = 1;
|
||||||
|
|
||||||
my @newnetworks;
|
my @newnetworks;
|
||||||
my @exclusions = ();
|
my @exclusions = ();
|
||||||
@ -757,10 +760,6 @@ sub add_group_to_zone($$$$$)
|
|||||||
my $allip = 0;
|
my $allip = 0;
|
||||||
|
|
||||||
for my $host ( @$networks ) {
|
for my $host ( @$networks ) {
|
||||||
$interfaceref = $interfaces{$interface};
|
|
||||||
|
|
||||||
$interfaceref->{zones}{$zone} = 1;
|
|
||||||
|
|
||||||
$interfaceref->{nets}++;
|
$interfaceref->{nets}++;
|
||||||
|
|
||||||
fatal_error "Invalid Host List" unless supplied $host;
|
fatal_error "Invalid Host List" unless supplied $host;
|
||||||
|
Loading…
Reference in New Issue
Block a user