mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 09:47:51 +02:00
Process the snat file if the masq file is empty
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
d9dc6bcfe2
commit
2d0cb5c2d8
@ -5642,15 +5642,23 @@ sub process_snat( )
|
|||||||
sub setup_snat( $ ) # Convert masq->snat if true
|
sub setup_snat( $ ) # Convert masq->snat if true
|
||||||
{
|
{
|
||||||
my $fn;
|
my $fn;
|
||||||
|
my $have_masq;
|
||||||
|
|
||||||
convert_masq() if $_[0];
|
if ( $_[0] ) {
|
||||||
|
convert_masq();
|
||||||
if ( $fn = open_file( 'masq', 1, 1 ) ) {
|
} elsif ( $fn = open_file( 'masq', 1, 1 ) ) {
|
||||||
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty masq file" , 's'; } );
|
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty masq file" , 's'; } );
|
||||||
process_one_masq(0) while read_a_line( NORMAL_READ );
|
process_one_masq(0), $have_masq = 1 while read_a_line( NORMAL_READ );
|
||||||
} elsif ( $fn = open_file( 'snat', 1, 1 ) ) {
|
}
|
||||||
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty snat file" , 's'; } );
|
|
||||||
process_snat while read_a_line( NORMAL_READ );
|
unless ( $have_masq ) {
|
||||||
|
#
|
||||||
|
# Masq file empty or didn't exist
|
||||||
|
#
|
||||||
|
if ( $fn = open_file( 'snat', 1, 1 ) ) {
|
||||||
|
first_entry( sub { progress_message2 "$doing $fn..."; require_capability 'NAT_ENABLED' , "a non-empty snat file" , 's'; } );
|
||||||
|
process_snat while read_a_line( NORMAL_READ );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user