forked from extern/shorewall_code
Use the 'id' member in copy_and_edit_table().
- Also add prohibit and unreachable to the existing blackhole case. Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
792a19bf4b
commit
e572d6ce50
@ -220,8 +220,8 @@ sub copy_table( $$$ ) {
|
||||
);
|
||||
}
|
||||
|
||||
sub copy_and_edit_table( $$$$ ) {
|
||||
my ( $duplicate, $number, $copy, $realm) = @_;
|
||||
sub copy_and_edit_table( $$$$$ ) {
|
||||
my ( $duplicate, $number, $id, $copy, $realm) = @_;
|
||||
|
||||
my $filter = $family == F_IPV6 ? q(fgrep -v ' cache ' | sed 's/ via :: / /' | ) : '';
|
||||
my %copied;
|
||||
@ -256,8 +256,8 @@ sub copy_and_edit_table( $$$$ ) {
|
||||
emit ( ' case $net in',
|
||||
' default)',
|
||||
' ;;',
|
||||
' blackhole)',
|
||||
" run_ip route add table $number blackhole \$route $realm",
|
||||
' blackhole|prohibit|unreachable)',
|
||||
" run_ip route add table $id \$net \$route $realm",
|
||||
' ;;',
|
||||
' *)',
|
||||
' case $(find_device $route) in',
|
||||
@ -267,12 +267,12 @@ sub copy_and_edit_table( $$$$ ) {
|
||||
' 255.255.255.255*)',
|
||||
' ;;',
|
||||
' *)',
|
||||
" run_ip route add table $number \$net \$route $realm",
|
||||
" run_ip route add table $id \$net \$route $realm",
|
||||
' ;;',
|
||||
' esac',
|
||||
);
|
||||
} else {
|
||||
emit ( " run_ip route add table $number \$net \$route $realm" );
|
||||
emit ( " run_ip route add table $id \$net \$route $realm" );
|
||||
}
|
||||
|
||||
emit ( ' ;;',
|
||||
@ -371,7 +371,6 @@ sub start_provider( $$$$$ ) {
|
||||
emit $test;
|
||||
push_indent;
|
||||
|
||||
|
||||
if ( $number ) {
|
||||
emit "qt ip -$family route flush table $id";
|
||||
emit "echo \"\$IP -$family route flush table $id > /dev/null 2>&1\" > \${VARDIR}/undo_${table}_routing";
|
||||
@ -776,7 +775,7 @@ CEOF
|
||||
$copy = "$interface,$copy";
|
||||
}
|
||||
|
||||
copy_and_edit_table( $duplicate, $number ,$copy , $realm);
|
||||
copy_and_edit_table( $duplicate, $number, $id, $copy, $realm);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user