From e545329eb96fec649e9e373822c62420266a4406 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 8 Aug 2014 10:34:29 -0700 Subject: [PATCH] Modify the preceding fix to work with wildcard interfaces Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Providers.pm | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 49d81e4d0..d48bbd617 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -457,14 +457,30 @@ sub process_a_provider( $ ) { my $interfaceref = known_interface( $interface ); fatal_error "Unknown Interface ($interface)" unless $interfaceref; - # - # Switch to the logical name if a physical name was passed - # - $interface = $interfaceref->{name}; fatal_error "A bridge port ($interface) may not be configured as a provider interface" if port_to_bridge $interface; - my $physical = get_physical $interface; + # + # Switch to the logical name if a physical name was passed + # + my $physical; + + if ( $interface eq $interfaceref->{name} ) { + # + # The logical interface name was specified + # + $physical = get_physical $interface; + } else { + # + # A Physical name was specified + # + $physical = $interface; + # + # Switch to the logical name unless it is a wildcard + # + $interface = $interfaceref->{name} unless $interfaceref->{name} =~ /\+$/; + } + my $gatewaycase = ''; if ( $physical =~ /\+$/ ) {