Add 'logname' member to chain table entries.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2018-02-20 11:04:50 -08:00
parent 0cb4a5c202
commit 4dfc6d90b9
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -2585,13 +2585,14 @@ sub reserved_name( $ ) {
# #
# Create a new chain and return a reference to it. # Create a new chain and return a reference to it.
# #
sub new_chain($$) sub new_chain($$;$)
{ {
my ($table, $chain) = @_; my ($table, $chain, $logchain) = @_;
assert( $chain_table{$table} && ! ( $chain_table{$table}{$chain} || $builtin_target{ $chain } ) ); assert( $chain_table{$table} && ! ( $chain_table{$table}{$chain} || $builtin_target{ $chain } ) );
my $chainref = { name => $chain, my $chainref = { name => $chain,
logname => $logchain || $chain,
rules => [], rules => [],
table => $table, table => $table,
loglevel => '', loglevel => '',
@ -2612,7 +2613,7 @@ sub new_chain($$)
# #
# Find a chain # Find a chain
# #
sub find_chain($$) { sub find_chain($$;$) {
my ($table, $chain) = @_; my ($table, $chain) = @_;
assert( $table && $chain && $chain_table{$table} ); assert( $table && $chain && $chain_table{$table} );
@ -2623,7 +2624,7 @@ sub find_chain($$) {
# #
# Create a chain if it doesn't exist already # Create a chain if it doesn't exist already
# #
sub ensure_chain($$) sub ensure_chain($$;$)
{ {
&find_chain( @_ ) || &new_chain( @_ ); &find_chain( @_ ) || &new_chain( @_ );
} }