diff --git a/Shorewall/Perl/Shorewall/Providers.pm b/Shorewall/Perl/Shorewall/Providers.pm index 7ed86adc6..6b63e3d87 100644 --- a/Shorewall/Perl/Shorewall/Providers.pm +++ b/Shorewall/Perl/Shorewall/Providers.pm @@ -513,7 +513,10 @@ sub add_a_provider( $$ ) { } } } - + + # + # /proc for this interface + # setup_interface_proc( $interface ); if ( $mark ne '-' ) { @@ -555,10 +558,10 @@ sub add_a_provider( $$ ) { emit "run_ip route add default via $gateway src $address dev $physical ${mtu}table $number $realm"; } - balance_default_route $balance , $gateway, $physical, $realm if $balance; + balance_default_route( $balance , $gateway, $physical, $realm ) if $balance; if ( $default > 0 ) { - balance_fallback_route $default , $gateway, $physical, $realm; + balance_fallback_route( $default , $gateway, $physical, $realm ); } elsif ( $default ) { emit ''; if ( $gateway ) { @@ -616,48 +619,55 @@ sub add_a_provider( $$ ) { 'if [ $COMMAND = enable ]; then' ); + push_indent; + my ( $tbl, $weight ); if ( $balance || $default ) { $tbl = $default || $config{USE_DEFAULT_RT} ? DEFAULT_TABLE : MAIN_TABLE; $weight = $balance ? $balance : $default; - push_indent; - if ( $gateway ) { emit qq(add_gateway "nexthop via $gateway dev $physical weight $weight $realm" ) . $tbl; } else { emit qq(add_gateway "nexthop dev $physical weight $weight $realm" ) . $tbl; } - pop_indent; } - emit " setup_${dev}_tc" if $tcdevices->{$interface}; + emit( "setup_${dev}_tc" ) if $tcdevices->{$interface}; - emit ( qq( progress_message2 " Provider $table ($number) Started"), - 'else', - qq( progress_message " Provider $table ($number) Started"), - "fi\n" - ); + emit ( qq(progress_message2 " Provider $table ($number) Started") ); pop_indent; + + emit( 'else', + qq( progress_message " Provider $table ($number) Started"), + "fi\n" + ); + + pop_indent; + emit 'else'; + push_indent; + if ( $optional ) { if ( $shared ) { - emit ( " error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Started\"" ); + emit ( "error_message \"WARNING: Gateway $gateway is not reachable -- Provider $table ($number) not Started\"" ); } else { - emit ( " error_message \"WARNING: Interface $physical is not usable -- Provider $table ($number) not Started\"" ); + emit ( "error_message \"WARNING: Interface $physical is not usable -- Provider $table ($number) not Started\"" ); } } else { if ( $shared ) { - emit( " fatal_error \"Gateway $gateway is not reachable -- Provider $table ($number) Cannot be Started\"" ); + emit( "fatal_error \"Gateway $gateway is not reachable -- Provider $table ($number) Cannot be Started\"" ); } else { - emit( " fatal_error \"Interface $physical is not usable -- Provider $table ($number) Cannot be Started\"" ); + emit( "fatal_error \"Interface $physical is not usable -- Provider $table ($number) Cannot be Started\"" ); } } + pop_indent; + emit 'fi'; pop_indent; diff --git a/Shorewall/lib.cli b/Shorewall/lib.cli index 30650cbf9..a669db3c0 100644 --- a/Shorewall/lib.cli +++ b/Shorewall/lib.cli @@ -1507,6 +1507,7 @@ hits_command() { $g_logread | grep "${today}IN=.* OUT=" | sed 's/\(.*SRC=\)\(.*\)\( DST=.*DPT=\)\([0-9]\{1,5\}\)\(.*\)/\2 \4/ t s/\(.*SRC=\)\(.*\)\( DST=.*\)/\2/' | sort | uniq -c | sort -rn | while read count address port; do + [ -z "$port" ] && port=0 printf '%7d %-15s %d\n' $count $address $port done