Make ROUTE_FILTER and LOG_MARTIANS tri-valued

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6052 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep
2007-04-21 21:24:38 +00:00
parent 145d33c044
commit 9c9546c55a
8 changed files with 82 additions and 21 deletions

View File

@ -95,7 +95,7 @@ sub setup_route_filtering() {
my $interfaces = find_interfaces_by_option 'routefilter';
if ( @$interfaces || $config{ROUTE_FILTER} ) {
if ( @$interfaces || ! ( $config{ROUTE_FILTER} =~ /keep/i ) ) {
progress_message2 "$doing Kernel Route Filtering...";
@ -114,9 +114,9 @@ sub setup_route_filtering() {
emit 'echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter';
if ( $config{ROUTE_FILTER} ) {
if ( $config{ROUTE_FILTER} =~ /yes/i ) {
emit 'echo 1 > /proc/sys/net/ipv4/conf/default/rp_filter';
} else {
} elsif ( $config{ROUTE_FILTER} =~ /no/i ) {
emit 'echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter';
}
@ -131,7 +131,7 @@ sub setup_route_filtering() {
sub setup_martian_logging() {
my $interfaces = find_interfaces_by_option 'logmartians';
if ( @$interfaces || $config{LOG_MARTIANS} ) {
if ( @$interfaces || ! ( $config{LOG_MARTIANS} =~ /keep/i ) ) {
progress_message2 "$doing Martian Logging...";
@ -149,14 +149,13 @@ sub setup_martian_logging() {
emit "fi\n";
}
if ( $config{LOG_MARTIANS} ) {
if ( $config{LOG_MARTIANS} =~ /yes/i ) {
emit 'echo 1 > /proc/sys/net/ipv4/conf/all/log_martians';
emit 'echo 1 > /proc/sys/net/ipv4/conf/default/log_martians';
} else {
} elsif ( $config{LOG_MARTIANS} =~ /no/i ) {
emit 'echo 0 > /proc/sys/net/ipv4/conf/all/log_martians';
emit 'echo 0 > /proc/sys/net/ipv4/conf/default/log_martians';
}
}
}