Move and simplify handling of nat columns

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-09-12 10:53:04 -07:00
parent e6a2ba78a4
commit 4f79d2e82b
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -2837,23 +2837,6 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
}
}
if ( $actiontype & ACTION ) {
my $dst = $dest;
if ( $dst eq '-' ) {
$dst = $nat_columns{dest};
} elsif ( ! $inchain ) {
#
# Remove zone from destination
#
$dst =~ s/.*://;
}
@nat_columns{'dest', 'proto', 'ports' } = ( $dst,
$proto eq '-' ? $nat_columns{proto} : $proto,
$ports eq '-' ? $nat_columns{ports} : $ports );
}
#
# Isolate and validate source and destination zones
#
@ -3019,6 +3002,12 @@ sub process_rule ( $$$$$$$$$$$$$$$$$$$$ ) {
if ( $actiontype & ACTION ) {
#
# Save NAT-oriented column contents
#
@nat_columns{'dest', 'proto', 'ports' } = ( $dest,
$proto eq '-' ? $nat_columns{proto} : $proto,
$ports eq '-' ? $nat_columns{ports} : $ports );
#
# Push the current column array onto the column stack
#
my @savecolumns = @columns;