From 515314f60ca7c3795f9ba236d7f0037d693e65ab Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 18 Dec 2008 01:28:16 +0000 Subject: [PATCH] Fix route_rules in IPv6 git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9109 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Providers.pm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Shorewall-perl/Shorewall/Providers.pm b/Shorewall-perl/Shorewall/Providers.pm index 7ecc2cf5a..3cfae211e 100644 --- a/Shorewall-perl/Shorewall/Providers.pm +++ b/Shorewall-perl/Shorewall/Providers.pm @@ -431,10 +431,21 @@ sub add_an_rtrule( $$$$ ) { if ( $source eq '-' ) { $source = 'from ' . ALLIP; - } elsif ( $source =~ /:/ ) { - ( my $interface, $source , my $remainder ) = split( /:/, $source, 3 ); - fatal_error "Invalid SOURCE" if defined $remainder; - validate_net ( $source, 0 ); + } elsif ( $family == F_IPV4 ) { + if ( $source =~ /:/ ) { + ( my $interface, $source , my $remainder ) = split( /:/, $source, 3 ); + fatal_error "Invalid SOURCE" if defined $remainder; + validate_net ( $source, 0 ); + $source = "iif $interface from $source"; + } elsif ( $source =~ /\..*\..*/ ) { + validate_net ( $source, 0 ); + $source = "from $source"; + } else { + $source = "iif $source"; + } + } elsif ( $source =~ /^(.+?):<(.+)>\s*$/ ) { + my ($interface, $source ) = ($1, $2); + validate_net ($source, 0); $source = "iif $interface from $source"; } elsif ( $source =~ /\..*\..*/ ) { validate_net ( $source, 0 );