diff --git a/New/Shorewall/Config.pm b/New/Shorewall/Config.pm index 2defa74d3..34a7c6293 100644 --- a/New/Shorewall/Config.pm +++ b/New/Shorewall/Config.pm @@ -355,7 +355,7 @@ sub get_configuration() { default_yes_no 'CLEAR_TC' , 'Yes'; default_yes_no 'CLAMPMSS' , '' unless $config{CLAMPMSS} =~ /^\d+$/; - unless ( $config{IP_ADD_ALIASES} || $config{ADD_SNAT_ALIASES} ) { + unless ( $config{ADD_IP_ALIASES} || $config{ADD_SNAT_ALIASES} ) { $config{RETAIN_ALIASES} = ''; } else { default_yes_no 'RETAIN_ALIASES' , ''; diff --git a/New/Shorewall/IPAddrs.pm b/New/Shorewall/IPAddrs.pm index b04a5fc20..abadfe270 100644 --- a/New/Shorewall/IPAddrs.pm +++ b/New/Shorewall/IPAddrs.pm @@ -29,6 +29,7 @@ use strict; our @ISA = qw(Exporter); our @EXPORT = qw( + ip_range_explicit ); our @EXPORT_OK = qw( ); our @VERSION = 1.00; diff --git a/New/Shorewall/Nat.pm b/New/Shorewall/Nat.pm index edd444fd8..37705a169 100644 --- a/New/Shorewall/Nat.pm +++ b/New/Shorewall/Nat.pm @@ -204,7 +204,7 @@ sub setup_one_masq($$$$$$) } else { $addr =~ s/^://; $addrlist .= "--to-ports $addr "; - } + } } $target .= $addrlist; @@ -219,7 +219,6 @@ sub setup_one_masq($$$$$$) if ( $add_snat_aliases ) { my ( $interface, $alias ) = split /:/, $fullinterface; - $alias = 0 unless defined $alias; for my $address ( split /,/, $addresses ) { my ( $addrs, $port ) = split /:/, $address; next unless $addrs; @@ -227,8 +226,12 @@ sub setup_one_masq($$$$$$) unless ( $addresses_to_add{$addr} ) { emit "del_ip_addr $addr $interface" unless $config{RETAIN_ALIASES}; $addresses_to_add{$addr} = 1; - push @addresses_to_add, $addr, "$interface:$alias"; - $alias++; + if ( defined $alias ) { + push @addresses_to_add, $addr, "$interface:$alias"; + $alias++; + } else { + push @addresses_to_add, $addr, $interface; + } } } } @@ -312,8 +315,7 @@ sub do_one_nat( $$$$$ ) $policyout = '-m policy --pol none --dir out'; } - fatal_error "Invalid nat file entry \"$line\"" - unless defined $interface and defined $internal; + fatal_error "Invalid nat file entry \"$line\"" unless defined $interface && defined $internal; if ( $add_ip_aliases ) { if ( $interface =~ s/:$// ) {