Fix spurios add of alias in nat file

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7862 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-12-08 17:37:04 +00:00
parent ce2fc3ad11
commit 8889d86d75
2 changed files with 7 additions and 5 deletions

View File

@ -754,6 +754,9 @@ sub initialize_chain_table()
sub finish_chain_section ($$) { sub finish_chain_section ($$) {
my ($chainref, $state ) = @_; my ($chainref, $state ) = @_;
my $chain = $chainref->{name}; my $chain = $chainref->{name};
my $savecomment = $comment;
$comment = '';
add_rule $chainref, "-m state --state $state -j ACCEPT" unless $config{FASTACCEPT}; add_rule $chainref, "-m state --state $state -j ACCEPT" unless $config{FASTACCEPT};
@ -777,6 +780,8 @@ sub finish_chain_section ($$) {
} }
} }
} }
$comment = $savecomment;
} }
# #

View File

@ -372,14 +372,11 @@ sub do_one_nat( $$$$$ )
fatal_error "Invalid nat file entry" unless defined $interface && defined $internal; fatal_error "Invalid nat file entry" unless defined $interface && defined $internal;
if ( $add_ip_aliases ) { if ( $add_ip_aliases ) {
if ( $interface =~ s/:$// ) { if ( defined( $alias ) && $alias eq '' ) {
$add_ip_aliases = ''; $add_ip_aliases = '';
} else { } else {
my ( $iface , undef ) = split /:/, $interface; emit "del_ip_addr $external $interface" unless $config{RETAIN_ALIASES};
emit "del_ip_addr $external $iface" unless $config{RETAIN_ALIASES};
} }
} else {
$interface =~ s/:$//;
} }
validate_nat_column 'ALL INTERFACES', \$allints; validate_nat_column 'ALL INTERFACES', \$allints;