mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-18 15:46:55 +02:00
Save load and status of each interface.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
93bd0b59a8
commit
b0f7c08844
@ -1788,7 +1788,7 @@ sub notrack_chain( $ )
|
|||||||
# Load Chain for a provider
|
# Load Chain for a provider
|
||||||
#
|
#
|
||||||
sub load_chain( $ ) {
|
sub load_chain( $ ) {
|
||||||
'~' . $_[0];
|
'~' . chain_base( $_[0] );
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -152,7 +152,7 @@ sub setup_route_marking() {
|
|||||||
|
|
||||||
for my $providerref ( @load_providers ) {
|
for my $providerref ( @load_providers ) {
|
||||||
|
|
||||||
my $chainref2 = new_chain( 'mangle', load_chain( $providerref->{provider} ) );
|
my $chainref2 = new_chain( 'mangle', load_chain( $providerref->{physical} ) );
|
||||||
|
|
||||||
dont_optimize $chainref2;
|
dont_optimize $chainref2;
|
||||||
dont_move $chainref2;
|
dont_move $chainref2;
|
||||||
@ -617,7 +617,13 @@ sub add_a_provider( $$ ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $load ) {
|
||||||
|
emit( qq(echo $load > \${VARDIR}/${physical}_load) );
|
||||||
|
emit( qq(echo "rm -f \${VARDIR}/${physical}_load" >> \${VARDIR}/undo_${table}_routing) );
|
||||||
|
}
|
||||||
|
|
||||||
|
emit( qq(echo "rm -f \${VARDIR}/${physical}.status" >> \${VARDIR}/undo_${table}_routing) );
|
||||||
#
|
#
|
||||||
# /proc for this interface
|
# /proc for this interface
|
||||||
#
|
#
|
||||||
@ -757,7 +763,7 @@ sub add_a_provider( $$ ) {
|
|||||||
$weight = 1;
|
$weight = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit( 'run_iptables -t mangle -A ' . load_chain( $table ) . ' -m statistic --mode random --probability ' . $load,
|
emit( 'run_iptables -t mangle -A ' . load_chain( $physical ) . ' -m statistic --mode random --probability ' . $load,
|
||||||
'' ) if $load;
|
'' ) if $load;
|
||||||
|
|
||||||
unless ( $shared ) {
|
unless ( $shared ) {
|
||||||
@ -768,12 +774,14 @@ sub add_a_provider( $$ ) {
|
|||||||
|
|
||||||
pop_indent;
|
pop_indent;
|
||||||
|
|
||||||
emit( 'else' ,
|
emit( 'else' );
|
||||||
|
emit( qq( echo 0 > \${VARDIR}/${physical}.status) ,
|
||||||
qq( echo $weight > \${VARDIR}/${physical}_weight) ,
|
qq( echo $weight > \${VARDIR}/${physical}_weight) ,
|
||||||
qq( progress_message " Provider $table ($number) Started"),
|
qq( progress_message " Provider $table ($number) Started"),
|
||||||
qq(fi\n)
|
qq(fi\n)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
emit( qq(echo 0 > \${VARDIR}/${physical}.status) );
|
||||||
emit( qq(progress_message "Provider $table ($number) Started") );
|
emit( qq(progress_message "Provider $table ($number) Started") );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,6 +790,8 @@ sub add_a_provider( $$ ) {
|
|||||||
emit 'else';
|
emit 'else';
|
||||||
|
|
||||||
push_indent;
|
push_indent;
|
||||||
|
|
||||||
|
emit( qq(echo 0 > \${VARDIR}/${physical}.status) );
|
||||||
|
|
||||||
if ( $optional ) {
|
if ( $optional ) {
|
||||||
if ( $shared ) {
|
if ( $shared ) {
|
||||||
@ -842,7 +852,7 @@ sub add_a_provider( $$ ) {
|
|||||||
"> $undo" );
|
"> $undo" );
|
||||||
|
|
||||||
emit( '',
|
emit( '',
|
||||||
'run_iptables -t mangle -X ' . load_chain( $table ) ) if $load;
|
'run_iptables -t mangle -X ' . load_chain( $physical ) ) if $load;
|
||||||
|
|
||||||
unless ( $shared ) {
|
unless ( $shared ) {
|
||||||
emit( '',
|
emit( '',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user