From 6c990a72538db60c02649d6837be0b1bb876d2e4 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 1 Jan 2014 07:18:00 -0800 Subject: [PATCH] Logically OR builtin definitions from the actions file if the builtin exists Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Rules.pm | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Rules.pm b/Shorewall/Perl/Shorewall/Rules.pm index fd3270957..f19774847 100644 --- a/Shorewall/Perl/Shorewall/Rules.pm +++ b/Shorewall/Perl/Shorewall/Rules.pm @@ -1789,16 +1789,22 @@ sub process_actions() { } if ( $builtin ) { - my $actiontype = USERBUILTIN | OPTIONS; - $actiontype |= MANGLE_TABLE if $mangle; - $actiontype |= RAW_TABLE if $raw; - $actiontype |= NAT_TABLE if $nat; + my $actiontype = USERBUILTIN | OPTIONS; + $actiontype |= MANGLE_TABLE if $mangle; + $actiontype |= RAW_TABLE if $raw; + $actiontype |= NAT_TABLE if $nat; # # For backward compatibility, we assume that user-defined builtins are valid in the filter table # - $actiontype |= FILTER_TABLE if $filter || ! ($mangle || $raw || $nat); - $builtin_target{$action} = $actiontype; - $targets{$action} = $actiontype; + $actiontype |= FILTER_TABLE if $filter || ! ($mangle || $raw || $nat); + + if ( $builtin_target{$action} ) { + $builtin_target{$action} |= $actiontype; + } else { + $builtin_target{$action} = $actiontype; + } + + $targets{$action} = $actiontype; } else { fatal_error "Table names are only allowed for builtin actions" if $mangle || $raw || $nat || $filter; new_action $action, $type, $noinline, $nolog;