forked from extern/shorewall_code
Correct bridge detection and 'qt' implementation
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
fc754040d5
commit
565fb74795
@ -1140,6 +1140,32 @@ sub warning_message
|
||||
$| = 0; #Re-allow output buffering
|
||||
}
|
||||
|
||||
#
|
||||
# Q[uie]t version of system(). Returns true for success
|
||||
#
|
||||
sub qt( $ ) {
|
||||
if ( $debug ) {
|
||||
print "SYS----> @_\n";
|
||||
system( "@_ 2>&1 < /dev/null" ) == 0;
|
||||
} else {
|
||||
system( "@_ > /dev/null 2>&1 < /dev/null" ) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub qt0( $ ) {
|
||||
if ( $debug ) {
|
||||
print "SYS----> @_\n";
|
||||
system( "@_ 2>&1 < /dev/null" );
|
||||
} else {
|
||||
system( "@_ > /dev/null 2>&1 < /dev/null" );
|
||||
}
|
||||
}
|
||||
|
||||
sub qt1( $ ) {
|
||||
1 while qt0( "@_" ) == 4;
|
||||
$? == 0;
|
||||
}
|
||||
|
||||
#
|
||||
# Delete the test chains
|
||||
#
|
||||
@ -3568,23 +3594,6 @@ sub load_kernel_modules( ) {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Q[uie]t version of system(). Returns true for success
|
||||
#
|
||||
sub qt( $ ) {
|
||||
if ( $debug ) {
|
||||
print "SYS----> @_\n";
|
||||
system( "@_ 2>&1" ) == 0;
|
||||
} else {
|
||||
system( "@_ > /dev/null 2>&1 < /dev/null" ) == 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub qt1( $ ) {
|
||||
1 while qt( "@_" ) == 4;
|
||||
$? == 0;
|
||||
}
|
||||
|
||||
#
|
||||
# Get the current kernel version
|
||||
#
|
||||
@ -4356,7 +4365,7 @@ sub determine_capabilities() {
|
||||
$capabilities{MASQUERADE_TGT} = detect_capability( 'MASQUERADE_TGT' );
|
||||
$capabilities{UDPLITEREDIRECT} = detect_capability( 'UDPLITEREDIRECT' );
|
||||
$capabilities{NEW_TOS_MATCH} = detect_capability( 'NEW_TOS_MATCH' );
|
||||
|
||||
|
||||
unless ( have_capability 'CT_TARGET' ) {
|
||||
$capabilities{HELPER_MATCH} = detect_capability 'HELPER_MATCH';
|
||||
}
|
||||
|
@ -965,7 +965,7 @@ sub local_zones() {
|
||||
# Determine if the passed physical device is a bridge
|
||||
#
|
||||
sub is_a_bridge( $ ) {
|
||||
which 'brctl' && qt( "brctl show | tail -n+2 | grep -q '^$_[0]\[\[:space:\]\]'" );
|
||||
which 'brctl' && system( "brctl show < /dev/null | tail -n+2 | grep -q '^$_[0]\[\[:space:\]\]' > /dev/null" ) == 0;
|
||||
}
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user