forked from extern/shorewall_code
Add a capability to use log levels as a target.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
65e1b1c9e7
commit
a4294658b6
@ -1588,6 +1588,11 @@ sub process_macro ( $$$$$$$$$$$$$$$$$$$) {
|
|||||||
$mtarget = substitute_param $param, $mtarget;
|
$mtarget = substitute_param $param, $mtarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $mtarget =~ s/&$// ) {
|
||||||
|
fatal_error "$mtarget& requires a parameter to be supplied in macro invocation" unless $param ne '';
|
||||||
|
$mtarget = "$mtarget:$macro($param)";
|
||||||
|
}
|
||||||
|
|
||||||
my $action = isolate_basic_target $mtarget;
|
my $action = isolate_basic_target $mtarget;
|
||||||
|
|
||||||
fatal_error "Invalid or missing ACTION ($mtarget)" unless defined $action;
|
fatal_error "Invalid or missing ACTION ($mtarget)" unless defined $action;
|
||||||
@ -1714,16 +1719,6 @@ sub process_rule1 ( $$$$$$$$$$$$$$$$$$ ) {
|
|||||||
( $basictarget, $actiontype , $param ) = map_old_actions( $basictarget ) unless $actiontype || $param;
|
( $basictarget, $actiontype , $param ) = map_old_actions( $basictarget ) unless $actiontype || $param;
|
||||||
}
|
}
|
||||||
|
|
||||||
unless ( $actiontype ) {
|
|
||||||
if ( $action =~ /^NFLOG\(?/ ) {
|
|
||||||
$basictarget = 'LOG';
|
|
||||||
$actiontype = $targets{LOG};
|
|
||||||
fatal_error "Invalid NFLOG action($action:$loglevel)" if $loglevel;
|
|
||||||
$loglevel = supplied $param ? "NFLOG($param)" : 'NFLOG';
|
|
||||||
$param = '';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fatal_error "Unknown ACTION ($action)" unless $actiontype;
|
fatal_error "Unknown ACTION ($action)" unless $actiontype;
|
||||||
|
|
||||||
if ( $actiontype == MACRO ) {
|
if ( $actiontype == MACRO ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user