mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-20 05:11:03 +01:00
Improve readability in Rules module
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3b20c0db54
commit
5b049d7e9e
@ -562,6 +562,9 @@ sub policy_rules( $$$$$ ) {
|
|||||||
|
|
||||||
if ( $default && $default ne 'none' ) {
|
if ( $default && $default ne 'none' ) {
|
||||||
if ( $default =~ s/^macro\.// ) {
|
if ( $default =~ s/^macro\.// ) {
|
||||||
|
#
|
||||||
|
# Default action is a macro -- expand it in-line
|
||||||
|
#
|
||||||
process_macro( $default, #Macro
|
process_macro( $default, #Macro
|
||||||
$chainref, #Chain
|
$chainref, #Chain
|
||||||
$default, #Target
|
$default, #Target
|
||||||
@ -583,6 +586,9 @@ sub policy_rules( $$$$$ ) {
|
|||||||
0, #Wildcard
|
0, #Wildcard
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
#
|
||||||
|
# Default action is an action -- jump to the action chain
|
||||||
|
#
|
||||||
add_ijump $chainref, j => $default;
|
add_ijump $chainref, j => $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,7 +602,7 @@ sub policy_rules( $$$$$ ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub report_syn_flood_protection() {
|
sub report_syn_flood_protection() {
|
||||||
progress_message_nocompress ' Enabled SYN flood protection';
|
progress_message_nocompress ' Enabled SYN flood Protection';
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1597,7 +1603,21 @@ sub process_macro ($$$$$$$$$$$$$$$$$$$) {
|
|||||||
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split_line1 'macro file', \%rulecolumns, $rule_commands;
|
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $mrate, $muser ) = split_line1 'macro file', \%rulecolumns, $rule_commands;
|
||||||
( $morigdest, $mmark, $mconnlimit, $mtime, $mheaders, $mcondition, $mhelper ) = qw/- - - - - - -/;
|
( $morigdest, $mmark, $mconnlimit, $mtime, $mheaders, $mcondition, $mhelper ) = qw/- - - - - - -/;
|
||||||
} else {
|
} else {
|
||||||
( $mtarget, $msource, $mdest, $mproto, $mports, $msports, $morigdest, $mrate, $muser, $mmark, $mconnlimit, $mtime, $mheaders, $mcondition, $mhelper ) = split_line1 'macro file', \%rulecolumns, $rule_commands;
|
( $mtarget,
|
||||||
|
$msource,
|
||||||
|
$mdest,
|
||||||
|
$mproto,
|
||||||
|
$mports,
|
||||||
|
$msports,
|
||||||
|
$morigdest,
|
||||||
|
$mrate,
|
||||||
|
$muser,
|
||||||
|
$mmark,
|
||||||
|
$mconnlimit,
|
||||||
|
$mtime,
|
||||||
|
$mheaders,
|
||||||
|
$mcondition,
|
||||||
|
$mhelper ) = split_line1 'macro file', \%rulecolumns, $rule_commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error 'TARGET must be specified' if $mtarget eq '-';
|
fatal_error 'TARGET must be specified' if $mtarget eq '-';
|
||||||
|
Loading…
Reference in New Issue
Block a user