diff --git a/Shorewall-perl/Shorewall/Nat.pm b/Shorewall-perl/Shorewall/Nat.pm index cd102bf71..f1e747e25 100644 --- a/Shorewall-perl/Shorewall/Nat.pm +++ b/Shorewall-perl/Shorewall/Nat.pm @@ -189,9 +189,11 @@ sub setup_one_masq($$$$$$$) if ( $interface =~ /(.*)[(](\w*)[)]$/ ) { $interface = $1; - my $realm = $2; + my $provider = $2; $fullinterface =~ s/[(]\w*[)]//; - $realm = lookup_provider( $realm ) unless $realm =~ /^\d+$/; + my $realm = lookup_provider( $provider ) unless $provider =~ /^\d+$/; + + fatal_error "$provider is not a shared-interface provider" unless $realm; $rule .= "-m realm --realm $realm "; } diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index b003e3f2b..c74a6c20f 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -587,7 +587,7 @@ sub lookup_provider( $ ) { fatal_error "Unknown provider ($provider)" unless $providerref; - $providerref->{number}; + $providerref->{shared} ? $providerref->{number} : 0; } 1;