mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-15 18:18:36 +01:00
Fix ADDRESSES = 'detect' on optional interface
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6146 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e8a4bb4469
commit
f22fc6575e
@ -190,6 +190,14 @@ sub setup_one_masq($$$$$$)
|
||||
' addrlist="$addrlist --to-source $address"',
|
||||
'done' );
|
||||
$target = '-j SNAT $addrlist';
|
||||
|
||||
if ( interface_is_optional $interface ) {
|
||||
add_commands( $chainref,
|
||||
'',
|
||||
'if [ -n "$addrlist" ]; then' );
|
||||
push_cmd_mode( $chainref );
|
||||
$detectaddress = 1;
|
||||
}
|
||||
} else {
|
||||
my $addrlist = '';
|
||||
for my $addr ( split /,/, $addresses ) {
|
||||
@ -212,6 +220,11 @@ sub setup_one_masq($$$$$$)
|
||||
#
|
||||
expand_rule $chainref , POSTROUTE_RESTRICT , $rule, $networks, $destnets, '', $target, '', '' , '';
|
||||
|
||||
if ( $detectaddress ) {
|
||||
pop_cmd_mode( $chainref );
|
||||
add_command( $chainref , 'fi' );
|
||||
}
|
||||
|
||||
if ( $add_snat_aliases ) {
|
||||
my ( $interface, $alias ) = split /:/, $fullinterface;
|
||||
for my $address ( split /,/, $addresses ) {
|
||||
|
Loading…
Reference in New Issue
Block a user