forked from extern/shorewall_code
Drop support for the 'notrack' file
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
8bed5c9d65
commit
e5c7ded951
@ -487,7 +487,6 @@ our %config_files = ( #accounting => 1,
|
|||||||
masq => 1,
|
masq => 1,
|
||||||
nat => 1,
|
nat => 1,
|
||||||
netmap => 1,
|
netmap => 1,
|
||||||
notrack => 1,
|
|
||||||
params => 1,
|
params => 1,
|
||||||
policy => 1,
|
policy => 1,
|
||||||
providers => 1,
|
providers => 1,
|
||||||
|
@ -56,7 +56,7 @@ sub initialize($) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Notrack
|
# Conntrack
|
||||||
#
|
#
|
||||||
sub process_conntrack_rule( $$$$$$$$$$ ) {
|
sub process_conntrack_rule( $$$$$$$$$$ ) {
|
||||||
|
|
||||||
@ -277,31 +277,18 @@ sub process_format( $ ) {
|
|||||||
|
|
||||||
sub setup_conntrack() {
|
sub setup_conntrack() {
|
||||||
|
|
||||||
for my $name ( qw/notrack conntrack/ ) {
|
my $fn = open_file( 'conntrack', 3 , 1 );
|
||||||
|
|
||||||
my $fn = open_file( $name, 3 , 1 );
|
|
||||||
|
|
||||||
if ( $fn ) {
|
if ( $fn ) {
|
||||||
|
|
||||||
my $action;
|
my $action;
|
||||||
|
|
||||||
my $empty = 1;
|
|
||||||
|
|
||||||
first_entry( "$doing $fn..." );
|
first_entry( "$doing $fn..." );
|
||||||
|
|
||||||
while ( read_a_line( NORMAL_READ ) ) {
|
while ( read_a_line( NORMAL_READ ) ) {
|
||||||
my ( $source, $dest, $protos, $ports, $sports, $user, $switch );
|
my ( $source, $dest, $protos, $ports, $sports, $user, $switch );
|
||||||
|
|
||||||
if ( $file_format == 1 ) {
|
|
||||||
( $source, $dest, $protos, $ports, $sports, $user, $switch ) =
|
|
||||||
split_line1( 'Conntrack File',
|
|
||||||
{ source => 0, dest => 1, proto => 2, dport => 3, sport => 4, user => 5, switch => 6 } );
|
|
||||||
$action = 'NOTRACK';
|
|
||||||
} else {
|
|
||||||
( $action, $source, $dest, $protos, $ports, $sports, $user, $switch ) = split_line1 'Conntrack File', { action => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, switch => 7 };
|
( $action, $source, $dest, $protos, $ports, $sports, $user, $switch ) = split_line1 'Conntrack File', { action => 0, source => 1, dest => 2, proto => 3, dport => 4, sport => 5, user => 6, switch => 7 };
|
||||||
}
|
|
||||||
|
|
||||||
$empty = 0;
|
|
||||||
|
|
||||||
for my $proto ( split_list $protos, 'Protocol' ) {
|
for my $proto ( split_list $protos, 'Protocol' ) {
|
||||||
if ( $file_format < 3 ) {
|
if ( $file_format < 3 ) {
|
||||||
@ -333,19 +320,6 @@ sub setup_conntrack() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $name eq 'notrack') {
|
|
||||||
if ( $empty ) {
|
|
||||||
if ( unlink( $fn ) ) {
|
|
||||||
warning_message "Empty notrack file ($fn) removed";
|
|
||||||
} else {
|
|
||||||
warning_message "Unable to remove empty notrack file ($fn): $!";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
warning_message "Non-empty notrack file ($fn); please move its contents to the conntrack file";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user