Emit more compact code when conditionally adding DOCKER chains

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2016-02-22 13:49:22 -08:00
parent 36b6863b02
commit 49536562e2

View File

@ -8472,9 +8472,7 @@ sub create_netfilter_load( $ ) {
assert( $chainref->{cmdlevel} == 0 , $name );
if ( $name eq 'DOCKER' ) {
enter_cmd_mode;
emit( 'if [ -n "$g_docker" ]; then',
' echo ":DOCKER - [0:0]" >&3',
'fi' );
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
enter_cat_mode;
} else {
emit_unindented ":$name - [0:0]";
@ -8569,9 +8567,7 @@ sub preview_netfilter_load() {
assert( $chainref->{cmdlevel} == 0 , $name );
if ( $name eq 'DOCKER' ) {
enter_cmd_mode;
emit( 'if [ -n "$g_docker" ]; then',
' echo ":DOCKER - [0:0]" >&3',
'fi' );
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
enter_cat_mode;
} else {
emit_unindented ":$name - [0:0]";
@ -8799,9 +8795,7 @@ sub create_stop_load( $ ) {
assert( $chainref->{cmdlevel} == 0 , $name );
if ( $name eq 'DOCKER' ) {
enter_cmd_mode;
emit( 'if [ -n "$g_docker" ]; then',
' echo ":DOCKER - [0:0]" >&3',
'fi' );
emit( '[ -n "$g_docker" ] && echo ":DOCKER - [0:0]" >&3' );
enter_cat_mode;
} else {
emit_unindented ":$name - [0:0]";