From 04943614e46b6ff231a5eaa3a1856c6e959292b4 Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 23 Mar 2007 21:24:28 +0000 Subject: [PATCH] More bug fixes git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5649 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Config.pm | 2 +- New/Shorewall/IPAddrs.pm | 1 + New/Shorewall/Nat.pm | 14 ++++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) 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/:$// ) {