From 5ec72dad6cbaa4e53b078b93e2f5f517484f6d20 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Thu, 16 May 2013 15:32:05 -0700 Subject: [PATCH] Add routes for standard tables when there are no providers. Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Providers.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 0f14943db..0b8e33e4e 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -1558,8 +1558,23 @@ sub setup_providers() { emit "\nundo_routing"; emit "restore_default_route $config{USE_DEFAULT_RT}"; + my $standard_routes = @{$providers{main}{routes}} || @{$providers{default}{routes}}; + if ( $config{NULL_ROUTE_RFC1918} ) { setup_null_routing; + emit "\nrun_ip route flush cache" unless $standard_routes; + } + + if ( $standard_routes ) { + for my $provider ( qw/main default/ ) { + emit ''; + emit qq(> \${VARDIR}/undo_${provider}_routing ); + emit ''; + emit $_ for @{$providers{$provider}{routes}}; + emit ''; + emit $_ for @{$providers{$provider}{rules}}; + } + emit "\nrun_ip route flush cache"; }