From 50030bcc2da262b2bb3c7336d9e7f147ed1ba705 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 8 Mar 2013 06:55:12 -0800 Subject: [PATCH] Revert "Don't allow routes to be added to non-Provider tables." This reverts commit 6f9a1ba29db05606087a004f9ca4ffde177f41db. --- Shorewall/Perl/Shorewall/Providers.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index ee7987498..3262630bb 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -1116,19 +1116,23 @@ sub add_a_route( ) { my $physical = $device eq '-' ? $providers{$provider}{physical} : physical_name( $device ); my $routes = $providerref->{routes}; - fatal_error "You may not add routes to the $provider table" if $number == UNSPEC_TABLE || $number >= DEFAULT_TABLE; + fatal_error "You may not add routes to the $provider table" if $number == LOCAL_TABLE || $number == UNSPEC_TABLE; if ( $gateway ne '-' ) { if ( $device ne '-' ) { push @$routes, qq(run_ip route add $dest via $gateway dev $physical table $number); + emit qq(echo "qt \$IP -$family route del $dest via $gateway dev $physical table $number" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE; } elsif ( $gateway eq 'blackhole' ) { push @$routes, qq(run_ip route add blackhole $dest table $number); + emit qq(echo "\$IP -$family route del blackhole $dest table $number" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE; } else { push @$routes, qq(run_ip route add $dest via $gateway table $number); + emit qq(echo "\$IP -$family route del $dest via $gateway table $number" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE; } } else { fatal_error "You must specify a device for this route" unless $physical; push @$routes, qq(run_ip route add $dest dev $physical table $number); + emit qq(echo "\$IP -$family route del $dest dev $physical table $number" >> \${VARDIR}/undo_${provider}_routing) if $number >= DEFAULT_TABLE; } progress_message " Route \"$currentline\" $done";