Correct bridge detection and 'qt' implementation

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-06-24 13:07:38 -07:00
parent fc754040d5
commit 565fb74795
2 changed files with 28 additions and 19 deletions

View File

@ -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
#

View File

@ -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;
}
#