diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index 286ce636a..881e8decc 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -754,6 +754,9 @@ sub initialize_chain_table() sub finish_chain_section ($$) { my ($chainref, $state ) = @_; my $chain = $chainref->{name}; + my $savecomment = $comment; + + $comment = ''; add_rule $chainref, "-m state --state $state -j ACCEPT" unless $config{FASTACCEPT}; @@ -777,6 +780,8 @@ sub finish_chain_section ($$) { } } } + + $comment = $savecomment; } # diff --git a/Shorewall-perl/Shorewall/Nat.pm b/Shorewall-perl/Shorewall/Nat.pm index 287355aa9..fc65ce275 100644 --- a/Shorewall-perl/Shorewall/Nat.pm +++ b/Shorewall-perl/Shorewall/Nat.pm @@ -372,14 +372,11 @@ sub do_one_nat( $$$$$ ) fatal_error "Invalid nat file entry" unless defined $interface && defined $internal; if ( $add_ip_aliases ) { - if ( $interface =~ s/:$// ) { + if ( defined( $alias ) && $alias eq '' ) { $add_ip_aliases = ''; } else { - my ( $iface , undef ) = split /:/, $interface; - emit "del_ip_addr $external $iface" unless $config{RETAIN_ALIASES}; + emit "del_ip_addr $external $interface" unless $config{RETAIN_ALIASES}; } - } else { - $interface =~ s/:$//; } validate_nat_column 'ALL INTERFACES', \$allints;