From 63ae00e4a472e1fb1347dea590a4af01108c5f46 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Tue, 15 May 2012 06:58:03 -0700 Subject: [PATCH] Fix bug in 'interface_is_usable' Signed-off-by: Tom Eastep --- Shorewall/lib.core | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Shorewall/lib.core b/Shorewall/lib.core index 5cc160d91..a8b5ea222 100644 --- a/Shorewall/lib.core +++ b/Shorewall/lib.core @@ -629,10 +629,12 @@ interface_is_usable() # $1 = interface local status; status=0 - if [ "$1" != lo -a "$COMMAND" != enable ]; then + if [ "$1" != lo ]; then if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ]; then - run_isusable_exit $1 + [ "$COMMAND" = enable ] || run_isusable_exit $1 status=$? + else + status=1 fi fi @@ -1028,10 +1030,12 @@ interface_is_usable() # $1 = interface local status; status=0 - if [ "$1" != lo -a "$COMMAND" != enable ]; then + if [ "$1" != lo ]; then if interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != :: ]; then - run_isusable_exit $1 + [ "$COMMAND" = enable ] || run_isusable_exit $1 status=$? + else + status=1 fi fi