mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-23 08:03:11 +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.
|
||||
#
|
||||
$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 {
|
||||
unless ( $wildcard ) {
|
||||
warning_message "The SOURCE zone in this rule is 'destonly'" if $sourceref->{destonly} && ! $sourceref->{complex};
|
||||
}
|
||||
|
||||
unless ( $actiontype & NATONLY ) {
|
||||
#
|
||||
# Check for illegal bridge port rule
|
||||
|
@ -747,8 +747,11 @@ sub add_group_to_zone($$$$$)
|
||||
my $zoneref = $zones{$zone};
|
||||
my $zonetype = $zoneref->{type};
|
||||
|
||||
|
||||
$interfaceref = $interfaces{$interface};
|
||||
$zoneref->{interfaces}{$interface} = 1;
|
||||
$zoneref->{destonly} ||= $interfaceref->{options}{destonly};
|
||||
|
||||
$interfaceref->{zones}{$zone} = 1;
|
||||
|
||||
my @newnetworks;
|
||||
my @exclusions = ();
|
||||
@ -757,10 +760,6 @@ sub add_group_to_zone($$$$$)
|
||||
my $allip = 0;
|
||||
|
||||
for my $host ( @$networks ) {
|
||||
$interfaceref = $interfaces{$interface};
|
||||
|
||||
$interfaceref->{zones}{$zone} = 1;
|
||||
|
||||
$interfaceref->{nets}++;
|
||||
|
||||
fatal_error "Invalid Host List" unless supplied $host;
|
||||
|
Loading…
Reference in New Issue
Block a user